[PATCH v6 2/3] ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx

Bartosz Golaszewski brgl at kernel.org
Mon Apr 27 07:48:42 PDT 2026


On Mon, Apr 27, 2026 at 4:44 PM Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>
> On Mon, Apr 27, 2026 at 12:46:33PM +0200, Bartosz Golaszewski wrote:
> > Ahead of changes attaching GPIO controller's software nodes referenced
> > from the Nokia 770 board files to their target devices, switch the
> > method for registering the platform devices to the
> > platform_device_register_full() variant. This is done to leverage the
> > new swnode field of struct platform_device_info which automate the
> > software node's registration and assignment.
>
> ...
>
> >       for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
> > -             pdev = omap16xx_gpio_dev[i];
> > +             pdevinfo = omap16xx_gpio_dev[i];
> >
> > -             res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +             res = &pdevinfo->res[0];
> >               if (unlikely(!res)) {
> >                       dev_err(&pdev->dev, "Invalid mem resource.\n");
> >                       return -ENODEV;
>
> >               base = ioremap(res->start, resource_size(res));
> >               if (unlikely(!base)) {
> > -                     dev_err(&pdev->dev, "ioremap failed.\n");
> > +                     pr_err("ioremap failed.\n");
> >                       return -ENOMEM;
> >               }
>
> Isn't this a stray change? Or why then? And why the previous dev_err() is left untouched?
>

We need this because we no longer have a struct device to pass to
dev_err() before calling platform_device_register_full(). And you're
right about the other instance of dev_err(), thanks.

Bart



More information about the linux-arm-kernel mailing list