diff options
author | Dejin Zheng <zhengdejin5@gmail.com> | 2020-04-14 21:48:27 +0800 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2020-04-15 12:12:52 +0200 |
commit | c02fb2b8067a4b940884fc58289adad0e3866d10 (patch) | |
tree | 513e25bf9381e9879dc6b30d98fd54bec67ead32 /drivers/i2c/busses/i2c-stm32f7.c | |
parent | e0442d76213981ab48e8ea0874bb6c47e3af5a36 (diff) |
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-stm32f7.c')
-rw-r--r-- | drivers/i2c/busses/i2c-stm32f7.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index 330ffed011e0..cf48f8df4423 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -1940,8 +1940,7 @@ static int stm32f7_i2c_probe(struct platform_device *pdev) if (!i2c_dev) return -ENOMEM; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - i2c_dev->base = devm_ioremap_resource(&pdev->dev, res); + i2c_dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(i2c_dev->base)) return PTR_ERR(i2c_dev->base); phy_addr = (dma_addr_t)res->start; |