Message ID | 20200908224006.25636-11-digetx@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | Improvements for Tegra I2C driver | expand |
On Wed, Sep 09, 2020 at 01:39:42AM +0300, Dmitry Osipenko wrote: > Driver now uses devm_platform_get_and_ioremap_resource() which replaces > the typical boilerplate code and makes code cleaner. > > Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > --- > drivers/i2c/busses/i2c-tegra.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Acked-by: Thierry Reding <treding@nvidia.com>
On Wed, 09 Sep 2020 01:39:42 +0300, Dmitry Osipenko wrote: > Driver now uses devm_platform_get_and_ioremap_resource() which replaces > the typical boilerplate code and makes code cleaner. > > Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> > Signed-off-by: Dmitry Osipenko <digetx@gmail.com> > Acked-by: Thierry Reding <treding@nvidia.com> > --- > drivers/i2c/busses/i2c-tegra.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Tested-by: Thierry Reding <treding@nvidia.com>
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 90ba2f5327c5..c2bbdf92b11f 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1678,12 +1678,12 @@ static int tegra_i2c_probe(struct platform_device *pdev) int irq; int ret; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base_phys = res->start; - 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); + base_phys = res->start; + res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!res) { dev_err(&pdev->dev, "no irq resource\n");