lkml.org 
[lkml]   [2020]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 11/12] i2c: designware: Move reg-space remapping into a dedicated function
On Wed, May 27, 2020 at 4:03 AM Serge Semin
<Sergey.Semin@baikalelectronics.ru> wrote:
>
> This is a preparation patch before adding a quirk with custom registers
> map creation required for the Baikal-T1 System I2C support. Since we've
> touched this code anyway let's replace
> platform_get_resource()-devm_ioremap_resource() tuple with ready-to-use
> helper devm_platform_get_and_ioremap_resource().

...

> +static int dw_i2c_plat_request_regs(struct dw_i2c_dev *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev->dev);

> + int ret = 0;

Redundant.

> + dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);

What's the point of this API if you don't use resource parameter?

> + if (IS_ERR(dev->base))
> + ret = PTR_ERR(dev->base);
> +
> + return ret;

return PTR_ERR_OR_ZERO(dev->base);

> +}

> - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - dev->base = devm_ioremap_resource(&pdev->dev, mem);
> - if (IS_ERR(dev->base))
> - return PTR_ERR(dev->base);

Wolfram, did my last series make your tree? I think there was a patch
that touched this part...

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2020-05-27 11:27    [W:0.137 / U:6.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site