[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e4319d3b058b8c90436b4401449e028f5e6c209e.camel@pengutronix.de>
Date: Wed, 25 Sep 2024 18:43:03 +0200
From: Philipp Zabel <p.zabel@...gutronix.de>
To: Uwe Kleine-König <u.kleine-koenig@...libre.com>
Cc: Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>, Masami Hiramatsu
<mhiramat@...nel.org>, Lad Prabhakar
<prabhakar.mahadev-lad.rj@...renesas.com>, Geert Uytterhoeven
<geert+renesas@...der.be>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, kernel@...gutronix.de
Subject: Re: [PATCH RFC 1/3] reset: replace boolean parameters with flags
parameter
Hi Uwe,
On Mi, 2024-09-25 at 16:25 +0200, Uwe Kleine-König wrote:
> Hello Philipp,
>
> On Wed, Jun 26, 2024 at 06:17:11PM +0200, Philipp Zabel wrote:
> > On Sa, 2024-06-22 at 09:47 +0200, Uwe Kleine-König wrote:
> > > On Fri, Jun 21, 2024 at 04:45:02PM +0200, Philipp Zabel wrote:
> > > > @@ -999,8 +1001,9 @@ static struct reset_controller_dev *__reset_find_rcdev(const struct of_phandle_a
> > > >
> > > > struct reset_control *
> > > > __of_reset_control_get(struct device_node *node, const char *id, int index,
> > > > - bool shared, bool optional, bool acquired)
> > > > + enum reset_control_flags flags)
> > > > {
> > > > + bool optional = flags & RESET_CONTROL_FLAGS_BIT_OPTIONAL;
> > > > bool gpio_fallback = false;
> > > > struct reset_control *rstc;
> > > > struct reset_controller_dev *rcdev;
> > > > @@ -1065,7 +1068,7 @@ __of_reset_control_get(struct device_node *node, const char *id, int index,
> > > > }
> > > >
> > > > /* reset_list_mutex also protects the rcdev's reset_control list */
> > > > - rstc = __reset_control_get_internal(rcdev, rstc_id, shared, acquired);
> > > > + rstc = __reset_control_get_internal(rcdev, rstc_id, flags);
> > >
> > > If RESET_CONTROL_FLAGS_BIT_OPTIONAL was passed to
> > > __of_reset_control_get(), you're forwarding it to
> > > __reset_control_get_internal(). But the latter doesn't do anything with
> > > that flag. I wonder if the API would be still less prone to error if
> > > you'd filter out RESET_CONTROL_FLAGS_BIT_OPTIONAL before passing to
> > > __reset_control_get_internal() and in __reset_control_get_internal() add
> > > a check for unsupported flags.
> >
> > Yes, I'll do that. For every enum value with the optional bit set,
> > there is a corresponding value without it.
>
> Do you have this still on your todo list? I just review a pwm driver
> that would benefit from devm_reset_control_get_exclusive_deasserted().
Thanks for the reminder, just sent a v2.
regards
Philipp
Powered by blists - more mailing lists