diff options
author | Dejin Zheng <zhengdejin5@gmail.com> | 2020-04-14 15:48:27 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2020-04-15 12:12:52 +0200 |
commit | c02fb2b8067a4b940884fc58289adad0e3866d10 (patch) | |
tree | 513e25bf9381e9879dc6b30d98fd54bec67ead32 /drivers/i2c/busses/i2c-cadence.c | |
parent | i2c: busses: convert to devm_platform_ioremap_resource (diff) | |
download | linux-c02fb2b8067a4b940884fc58289adad0e3866d10.tar.xz linux-c02fb2b8067a4b940884fc58289adad0e3866d10.zip |
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-cadence.c')
-rw-r--r-- | drivers/i2c/busses/i2c-cadence.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c index 89d58f7d2a25..803c802611eb 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -906,8 +906,7 @@ static int cdns_i2c_probe(struct platform_device *pdev) id->quirks = data->quirks; } - r_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - id->membase = devm_ioremap_resource(&pdev->dev, r_mem); + id->membase = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem); if (IS_ERR(id->membase)) return PTR_ERR(id->membase); |