Re: [PATCH v2] gpio: regmap: move drvdata to config data
From: Bartosz Golaszewski
Date: Mon Jun 07 2021 - 09:39:58 EST
On Sat, Jun 5, 2021 at 1:01 AM Michael Walle <michael@xxxxxxxx> wrote:
>
> Drop gpio_regmap_set_drvdata() and instead add it to the configuration
> data passed to gpio_regmap_register().
>
> gpio_regmap_set_drvdata() can't really be used in a race free way. This
> is because the gpio_regmap object which is needed by _set_drvdata() is
> returned by gpio_regmap_register(). On the other hand, the callbacks
> which use the drvdata might already be called right after the
> gpiochip_add() call in gpio_regmap_register(). Therefore, we have to
> provide the drvdata early before we call gpiochip_add().
>
> Signed-off-by: Matti Vaittinen <matti.vaittinen@xxxxxxxxxxxxxxxxx>
> Signed-off-by: Michael Walle <michael@xxxxxxxx>
> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
Applied, thanks!
Bart