Message ID | 202211101723428058432@zte.com.cn |
---|---|
State | New |
Headers | show |
Series | i2c: imx: use devm_platform_get_and_ioremap_resource() | expand |
On Thu, Nov 10, 2022 at 05:23:42PM +0800, ye.xingchen@zte.com.cn wrote: > From: Minghao Chi <chi.minghao@zte.com.cn> > > Convert platform_get_resource(), devm_ioremap_resource() to a single > call to devm_platform_get_and_ioremap_resource(), as this is exactly > what this function does. > > Reported-by: Zeal Robot <zealci@zte.com.cn> > Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> As res is used later, we cannot switch to devm_platform_ioremap_resource(), so the patch is fine. Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Best regards Uwe
On Thu, Nov 10, 2022 at 05:23:42PM +0800, ye.xingchen@zte.com.cn wrote: > From: Minghao Chi <chi.minghao@zte.com.cn> > > Convert platform_get_resource(), devm_ioremap_resource() to a single > call to devm_platform_get_and_ioremap_resource(), as this is exactly > what this function does. > > Reported-by: Zeal Robot <zealci@zte.com.cn> > Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Applied to for-next, thanks!
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 3082183bd66a..1ce0cf7a323f 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1449,8 +1449,7 @@ static int i2c_imx_probe(struct platform_device *pdev) if (irq < 0) return irq; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(&pdev->dev, res); + base = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(base)) return PTR_ERR(base);