lkml.org 
[lkml]   [2021]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v7 2/6] gpio: Add Delta TN48M CPLD GPIO driver
On Sat, Nov 6, 2021 at 12:19 AM Michael Walle <michael@walle.cc> wrote:
>
> Am 2021-11-05 12:34, schrieb Robert Marko:
> > On Tue, Nov 2, 2021 at 8:28 PM Andy Shevchenko
> > <andy.shevchenko@gmail.com> wrote:
> >>
> >> On Tue, Nov 2, 2021 at 6:57 PM Robert Marko <robert.marko@sartura.hr>
> >> wrote:
> >> >
> >> > Delta TN48M switch has an onboard Lattice CPLD that is used as a GPIO
> >> > expander.
> >> >
> >> > The CPLD provides 12 pins in total on the TN48M, but on more advanced
> >> > switch models it provides up to 192 pins, so the driver is extendable
> >> > to support more switches.
> >>
> >> ...
> >>
> >> > +static int tn48m_gpio_probe(struct platform_device *pdev)
> >> > +{
> >>
> >> > + const struct tn48m_gpio_config *gpio_config = NULL;
> >> > + struct gpio_regmap_config config = {0};
> >>
> >> I don't see a point in assigning these variables.
> >
> > Hi,
> > The NULL one isn't required, but the regmap one is, otherwise the
> > devm_gpio_regmap_register call will
> > return -EINVAL.
> >
> > It will fail here:
> > https://elixir.bootlin.com/linux/latest/source/drivers/gpio/gpio-regmap.c#L209
> >
> > I see that Michael Walle who did the GPIO regmap uses it as well in
> > the Kontron CPLD driver.
> > Michael, can you shed some light on this?
>
> I guess this was already clarified? Because you don't set
> all the properties of the config you have to initialize it.
> Otherwise anything could happen.

Yeah, I think it's clear now.
Thanks,
Robert
>
> -michael



--
Robert Marko
Staff Embedded Linux Engineer
Sartura Ltd.
Lendavska ulica 16a
10000 Zagreb, Croatia
Email: robert.marko@sartura.hr
Web: www.sartura.hr

\
 
 \ /
  Last update: 2021-11-09 12:18    [W:0.102 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site