summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-pca-platform.c
diff options
context:
space:
mode:
authorDejin Zheng <zhengdejin5@gmail.com>2020-04-14 16:48:27 +0300
committerWolfram Sang <wsa@the-dreams.de>2020-04-15 13:12:52 +0300
commitc02fb2b8067a4b940884fc58289adad0e3866d10 (patch)
tree513e25bf9381e9879dc6b30d98fd54bec67ead32 /drivers/i2c/busses/i2c-pca-platform.c
parente0442d76213981ab48e8ea0874bb6c47e3af5a36 (diff)
downloadlinux-c02fb2b8067a4b940884fc58289adad0e3866d10.tar.xz
i2c: busses: convert to devm_platform_get_and_ioremap_resource
use devm_platform_get_and_ioremap_resource() to simplify code, which contains platform_get_resource() and devm_ioremap_resource(), it also get the resource for use by the following code. Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-pca-platform.c')
-rw-r--r--drivers/i2c/busses/i2c-pca-platform.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c
index 635dd697ac0b..546426a470cc 100644
--- a/drivers/i2c/busses/i2c-pca-platform.c
+++ b/drivers/i2c/busses/i2c-pca-platform.c
@@ -149,8 +149,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev)
if (!i2c)
return -ENOMEM;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- i2c->reg_base = devm_ioremap_resource(&pdev->dev, res);
+ i2c->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(i2c->reg_base))
return PTR_ERR(i2c->reg_base);