Re: [PATCH v3 3/5] iio: st_sensors: remove st_sensors_power_disable() function

From: Linus Walleij
Date: Fri Aug 27 2021 - 18:32:51 EST


On Mon, Aug 23, 2021 at 1:22 PM Alexandru Ardelean
<aardelean@xxxxxxxxxxx> wrote:

> This change converts the st_sensors_power_enable() function to use
> devm_add_action_or_reset() handlers to register regulator_disable hooks for
> when the drivers get unloaded.
>
> The parent device of the IIO device object is used. This is based on the
> assumption that all other devm_ calls in the ST sensors use this reference.
>
> This makes the st_sensors_power_disable() un-needed.
> Removing this also changes unload order a bit, as all ST drivers would call
> st_sensors_power_disable() first and iio_device_unregister() after that.
>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> Signed-off-by: Alexandru Ardelean <aardelean@xxxxxxxxxxx>

Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

We should at some point add proper runtime PM to the ST sensors
(cf drivers/iio/gyro/mpu3050-core.c) but that can certainly be built
on top of this patch.

Yours,
Linus Walleij