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>
This commit is contained in:
Anton Vasilyev 2017-08-10 18:15:45 +03:00 committed by Wolfram Sang
parent f4b17a14fa
commit 42543aeb48

View File

@ -127,8 +127,7 @@ static int simtec_i2c_probe(struct platform_device *dev)
iounmap(pd->reg); iounmap(pd->reg);
err_res: err_res:
release_resource(pd->ioarea); release_mem_region(pd->ioarea->start, size);
kfree(pd->ioarea);
err: err:
kfree(pd); kfree(pd);
@ -142,8 +141,7 @@ static int simtec_i2c_remove(struct platform_device *dev)
i2c_del_adapter(&pd->adap); i2c_del_adapter(&pd->adap);
iounmap(pd->reg); iounmap(pd->reg);
release_resource(pd->ioarea); release_mem_region(pd->ioarea->start, resource_size(pd->ioarea));
kfree(pd->ioarea);
kfree(pd); kfree(pd);
return 0; return 0;