Re: [PATCH v3 05/10] gpio: aggregator: refactor the forwarder registration part

From: Andy Shevchenko
Date: Thu Apr 17 2025 - 13:19:43 EST


On Wed, Apr 16, 2025 at 04:08:13PM +0200, Thomas Richard wrote:
> Add a new function gpiochip_fwd_register(), which finalizes the
> initialization of the forwarder and registers the corresponding gpiochip.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
with one nit-pick below.

...

> +static int gpiochip_fwd_register(struct gpiochip_fwd *fwd)
> +{
> + struct gpio_chip *chip = &fwd->chip;

> + int error;

Not needed in this change.

> + if (chip->can_sleep)
> + mutex_init(&fwd->mlock);
> + else
> + spin_lock_init(&fwd->slock);

> + error = devm_gpiochip_add_data(chip->parent, chip, fwd);
> +
> + return error;

return devm_...

Make it differently when you will need this.

> +}

--
With Best Regards,
Andy Shevchenko