[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqJ_EqsxrY67OPm+t6tU5ikFA-TZ-fFqHPYQMuy16c_kLg@mail.gmail.com>
Date: Tue, 8 Apr 2025 10:19:32 -0500
From: Rob Herring <robh@...nel.org>
To: Sean Anderson <sean.anderson@...ux.dev>
Cc: Saravana Kannan <saravanak@...gle.com>, devicetree@...r.kernel.org,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, "Rafael J . Wysocki" <rafael@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Len Brown <lenb@...nel.org>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>, Daniel Scally <djrscally@...il.com>,
linux-kernel@...r.kernel.org, Danilo Krummrich <dakr@...nel.org>, linux-acpi@...r.kernel.org
Subject: Re: [PATCH 2/2] device property: Add fwnode_property_get_reference_optional_args
On Tue, Apr 8, 2025 at 10:12 AM Sean Anderson <sean.anderson@...ux.dev> wrote:
>
> On 4/8/25 09:00, Rob Herring wrote:
> > On Mon, Apr 7, 2025 at 5:37 PM Sean Anderson <sean.anderson@...ux.dev> wrote:
> >>
> >> Add a fwnode variant of of_parse_phandle_with_optional_args to allow
> >> nargs_prop to be absent from the referenced node. This improves
> >> compatibility for references where the devicetree might not always have
> >> nargs_prop.
> >
> > Can't we just make fwnode_property_get_reference_args() handle this
> > case? Or why is it not just a 1 line wrapper function?
>
> fwnode_property_get_reference_args ignores nargs when nargs_prop is
> non-NULL. So all the existing callers just pass 0 to nargs. Rather than
> convert them, I chose to add another function with different defaults.
> There are only four callers that pass nargs_prop, so I could just as
> easily change the callers instead.
Why do you have to change the callers? nargs value won't matter
because they obviously have nargs_prop present or they would not have
worked in the first place. If behavior changes because there's an
error in their DT, who cares. That's their problem for not validating
the DT.
Rob
Powered by blists - more mailing lists