Re: [PATCH v4 1/2] gpio: add GPO driver for PCA9570

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 3, 2020 at 3:13 AM Sungbo Eo <mans0n@xxxxxxxxxx> wrote:
> On 2020-07-02 21:36, Andy Shevchenko wrote:
> >> +       gpio->chip.ngpio = i2c_match_id(pca9570_id_table, client)->driver_data;
> >
> > Oh, avoid direct access to the table like this. And you may simply use
> > device_get_match_data().
>
> I'm not sure if it really does the same thing, but I'll try following
> your suggestion.

It's an agnostic way to get it from fwnode enumerated devices. Since
you are using ->probe_new() the driver should rely on fwnode, that's
why the OF table has to have driver data be defined.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux