Re: [PATCH v2 0/3] reset: Requesting pre-deasserted, auto-reasserting reset controls via devres
From: Uwe Kleine-König
Date: Thu Sep 26 2024 - 01:57:24 EST
Hello Philipp,
On Wed, Sep 25, 2024 at 06:40:08PM +0200, Philipp Zabel wrote:
> There is a recurring pattern of drivers requesting a reset control and
> deasserting the reset during probe, followed by registering a reset
> assertion via devm_add_action_or_reset().
>
> We can simplify this by providing devm_reset_control_get_*_deasserted()
> helpers that return an already deasserted reset control, similarly to
> devm_clk_get_enabled().
>
> This doesn't remove a lot of boilerplate at each instance, but there are
> quite a few of them now.
I really like it, thanks for respinning!
Acked-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxx>
Two small notes: I think __devm_reset_control_get() could be a bit
simplified if it used devm_add_action_or_reset() instead of
devres_alloc() + devres_add(). I also would have prefered an if block
(or a function pointer) in the release function instead of a ?:
construct to select the right release function like e.g.
__devm_clk_get() does it. But that's both subjective I think and
orthogonal to this patch set.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature