Re: [PATCH v7 3/3] gpio: ad7768: Add AD7768 GPIO auxiliary driver

From: Andy Shevchenko

Date: Thu Sep 10 2026 - 11:46:02 EST


On Thu, Sep 10, 2026 at 05:07:12PM +0200, Janani Sunil wrote:
> On 9/8/26 12:47, Andy Shevchenko wrote:
> > On Tue, Sep 08, 2026 at 09:24:54AM +0200, Janani Sunil wrote:
> > > The AD7768 provides five GPIOs controlled through registers shared
> > > with the parent IIO device. Register an auxiliary gpio-regmap driver
> > > and use the parent device for runtime PM.
> > >
> > > The device has separate input-state and output-latch registers. Add a
> > > reg_mask_xlate() callback that checks the line direction and reads the
> > > programmed output latch for output lines while retaining input-state
> > > reads for input lines.

...

> > > + if (ngpios > AD7768_FILTER_GPIO &&
> > > + device_property_match_string(gc->parent->parent, "clock-names",
> > > + "mclk") < 0)
> > Looking at the length of the line I have just noticed that this uses
> > gc->parent->parent. Here is the question: what does gc->fwnode refer to?
> >
> gc->fwnode is currently null. Would you prefer that I explicitly set
> config.fwnode = dev_fwnode(parent) and use the fwnode_property_match_string()
> here instead of walking gc->parent->parent?

Yes. It's very unusual to access gc->parent->parent in the drivers. IIRC none
is doing like this (out of GPIO drivers).

--
With Best Regards,
Andy Shevchenko