Messages in this thread Patch in this message | | | From | Dejin Zheng <> | Subject | [PATCH v2 10/24] i2c: meson: convert to devm_platform_ioremap_resource | Date | Thu, 9 Apr 2020 02:22:57 +0800 |
| |
use devm_platform_ioremap_resource() to simplify code, which contains platform_get_resource and devm_ioremap_resource.
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> --- v1 -> v2: - no changed
drivers/i2c/busses/i2c-meson.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c index 06b3bed78421..b3bd869281d3 100644 --- a/drivers/i2c/busses/i2c-meson.c +++ b/drivers/i2c/busses/i2c-meson.c @@ -397,7 +397,6 @@ static int meson_i2c_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct meson_i2c *i2c; - struct resource *mem; struct i2c_timings timings; int irq, ret = 0; @@ -422,8 +421,7 @@ static int meson_i2c_probe(struct platform_device *pdev) return PTR_ERR(i2c->clk); } - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - i2c->regs = devm_ioremap_resource(&pdev->dev, mem); + i2c->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(i2c->regs)) return PTR_ERR(i2c->regs); -- 2.25.0
| |