summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorAnton Vasilyev <vasilyev@ispras.ru>2017-08-10 18:15:45 +0300
committerWolfram Sang <wsa@the-dreams.de>2017-08-14 22:39:21 +0300
commit42543aeb48e3701b49e0a83654248afc38feb88f (patch)
treee7539743b4468838f51dd70ab3366f4b5d7dd080 /drivers/i2c
parentf4b17a14faeec4160f97ad75ea7534f571f12404 (diff)
downloadlinux-42543aeb48e3701b49e0a83654248afc38feb88f.tar.xz
i2c: simtec: use release_mem_region instead of release_resource
Use api pair of request_mem_region and release_mem_region instead of release_resource. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-simtec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-simtec.c b/drivers/i2c/busses/i2c-simtec.c
index b4685bb9b5d7..adca51a99487 100644
--- a/drivers/i2c/busses/i2c-simtec.c
+++ b/drivers/i2c/busses/i2c-simtec.c
@@ -127,8 +127,7 @@ static int simtec_i2c_probe(struct platform_device *dev)
iounmap(pd->reg);
err_res:
- release_resource(pd->ioarea);
- kfree(pd->ioarea);
+ release_mem_region(pd->ioarea->start, size);
err:
kfree(pd);
@@ -142,8 +141,7 @@ static int simtec_i2c_remove(struct platform_device *dev)
i2c_del_adapter(&pd->adap);
iounmap(pd->reg);
- release_resource(pd->ioarea);
- kfree(pd->ioarea);
+ release_mem_region(pd->ioarea->start, resource_size(pd->ioarea));
kfree(pd);
return 0;