[PATCH v2 3/3] iio: adc: meson_saradc: Use temporary variable for struct device

Andy Shevchenko andy.shevchenko at gmail.com
Thu Jun 2 06:45:27 PDT 2022


On Thu, Jun 2, 2022 at 2:08 PM Lars-Peter Clausen <lars at metafoo.de> wrote:
> On 6/2/22 13:42, Andy Shevchenko wrote:

...

> > -     priv->adc_clk = devm_clk_register(&indio_dev->dev, &priv->clk_gate.hw);
> > +     priv->adc_clk = devm_clk_register(idev, &priv->clk_gate.hw);
>
> You are not changing anything here.

The scope of patch is supposed not to change the current behaviour :-)

> But we shouldn't be devm'ing on the
> IIO device. It will get freed eventually, but only when the last
> reference to the iio device has been dropped, which might be long after
> the platform device has been removed. devm'ing should happen on the
> platform_device's device. Might be worth fixing.

Thanks for confirming my suspicions (as I mentioned to Martin, using
an IIO device there feels wrong).
I will add another patch to v3.

-- 
With Best Regards,
Andy Shevchenko



More information about the linux-amlogic mailing list