diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-12-18 02:48:07 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-01-04 22:23:09 +0100 |
commit | 34d7ffa064a509241f0aa760cddb5008cfd951fc (patch) | |
tree | 9771350e9eeaf8cd2dcf7d5b76cf0173dd796fb6 /drivers/i2c/busses/i2c-isch.c | |
parent | i2c: viperboard: Use devm_kzalloc() functions (diff) | |
download | linux-34d7ffa064a509241f0aa760cddb5008cfd951fc.tar.xz linux-34d7ffa064a509241f0aa760cddb5008cfd951fc.zip |
i2c: isch: Use devm_request_region()
Use devm_request_region() to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-isch.c')
-rw-r--r-- | drivers/i2c/busses/i2c-isch.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c index 8c38aaa7417c..af213045ab7e 100644 --- a/drivers/i2c/busses/i2c-isch.c +++ b/drivers/i2c/busses/i2c-isch.c @@ -275,7 +275,8 @@ static int smbus_sch_probe(struct platform_device *dev) if (!res) return -EBUSY; - if (!request_region(res->start, resource_size(res), dev->name)) { + if (!devm_request_region(&dev->dev, res->start, resource_size(res), + dev->name)) { dev_err(&dev->dev, "SMBus region 0x%x already in use!\n", sch_smba); return -EBUSY; @@ -294,7 +295,6 @@ static int smbus_sch_probe(struct platform_device *dev) retval = i2c_add_adapter(&sch_adapter); if (retval) { dev_err(&dev->dev, "Couldn't register adapter!\n"); - release_region(res->start, resource_size(res)); sch_smba = 0; } @@ -303,11 +303,8 @@ static int smbus_sch_probe(struct platform_device *dev) static int smbus_sch_remove(struct platform_device *pdev) { - struct resource *res; if (sch_smba) { i2c_del_adapter(&sch_adapter); - res = platform_get_resource(pdev, IORESOURCE_IO, 0); - release_region(res->start, resource_size(res)); sch_smba = 0; } |