Re: [PATCH v2 7/9] reset: make the provider of reset-gpios the parent of the reset device
From: Philipp Zabel
Date: Wed Oct 22 2025 - 10:45:44 EST
On Mi, 2025-10-22 at 15:41 +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
>
> Auxiliary devices really do need a parent so ahead of converting the
> reset-gpios driver to registering on the auxiliary bus, make the GPIO
> device that provides the reset GPIO the parent of the reset-gpio device.
> To that end move the lookup of the GPIO device by fwnode to the
> beginning of __reset_add_reset_gpio_device() which has the added benefor
Still typo: benefit.
> of bailing out earlier, before allocating resources for the virtual
> device, if the chip is not up yet.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
> ---
> drivers/reset/core.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> index 5a696e2dbcc224a633e2b321da53b7bc699cb5f3..ad85ddc8dd9fcf8b512cb09168586e0afca257f1 100644
> --- a/drivers/reset/core.c
> +++ b/drivers/reset/core.c
[...]
> @@ -919,6 +915,11 @@ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args)
> if (args->args_count != 2)
> return -ENOENT;
>
> + struct gpio_device *gdev __free(gpio_device_put) =
> + gpio_device_find_by_fwnode(of_fwnode_handle(args->np));
> + if (!gdev)
> + return -EPROBE_DEFER;
> +
> /*
> * Registering reset-gpio device might cause immediate
> * bind, resulting in its probe() registering new reset controller thus
Please move this after the lockdep_assert_not_held(), as discussed.
With that change,
Reviewed-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
regards
Philipp