[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75Vf_yHVhZS4ghZK5aZ7sQjdZ_1_MT=Ke6vVfUBRpL70-Eg@mail.gmail.com>
Date: Fri, 24 Feb 2023 20:16:21 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Asmaa Mnebhi <asmaa@...dia.com>
Cc: linus.walleij@...aro.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] gpio: mmio: handle "ngpios" properly in bgpio_init
On Fri, Feb 24, 2023 at 7:40 PM Asmaa Mnebhi <asmaa@...dia.com> wrote:
>
> bgpio_init uses "sz" argument to populate ngpio, which is not accurate.
bgpio_init() uses the
(Note parentheses, same for other func() mentions)
> Instead, read the "ngpios" property from the DT and if it
> doesn't exist, use the "sz" argument. With this change, drivers no
> longer need to overwrite the ngpio variable after calling bgpio_init.
Thank you!
...
> + ret = device_property_read_u32(dev, "ngpios", &ngpios);
> + if (!ret)
> + gc->ngpio = ngpios;
> + else
> + gc->ngpio = gc->bgpio_bits;
This duplicates the GPIO library. What probably better to have is to
just check the property existence
device_property_present() and do accordingly.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists