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

Andy Shevchenko
2025-04-17T17:18:52Z

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@linux.intel.com>
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