[PATCH v2 0/3] reset: Requesting pre-deasserted, auto-reasserting reset controls via devres
Uwe Kleine-König
u.kleine-koenig at baylibre.com
Wed Sep 25 22:57:08 PDT 2024
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 at baylibre.com>
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240926/529f85b2/attachment.sig>
More information about the linux-arm-kernel
mailing list