linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Jonathan Cameron <jic23@kernel.org>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [PATCH v2 3/3] iio: adc: meson_saradc: Use temporary variable for struct device
Date: Thu, 2 Jun 2022 13:53:53 +0200	[thread overview]
Message-ID: <ad3af033-97f1-3aad-d082-c6ed56185b59@metafoo.de> (raw)
In-Reply-To: <20220602114241.12601-3-andriy.shevchenko@linux.intel.com>

On 6/2/22 13:42, Andy Shevchenko wrote:
return -ENOMEM;
>   
> @@ -690,7 +687,7 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev,
>   	priv->clk_gate.bit_idx = __ffs(MESON_SAR_ADC_REG3_CLK_EN);
>   	priv->clk_gate.hw.init = &init;
>   
> -	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. 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.

>   	if (WARN_ON(IS_ERR(priv->adc_clk)))
>   		return PTR_ERR(priv->adc_clk);
>   
> @@ -706,8 +703,7 @@ static int meson_sar_adc_temp_sensor_init(struct iio_dev *indio_dev)
>   	size_t read_len;
>   	


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2022-06-02 11:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 11:42 [PATCH v2 1/3] iio: adc: meson_saradc: Convert to use dev_err_probe() Andy Shevchenko
2022-06-02 11:42 ` [PATCH v2 2/3] iio: adc: meson_saradc: Use devm_clk_get_optional() Andy Shevchenko
2022-06-02 11:42 ` [PATCH v2 3/3] iio: adc: meson_saradc: Use temporary variable for struct device Andy Shevchenko
2022-06-02 11:53   ` Lars-Peter Clausen [this message]
2022-06-02 13:45     ` Andy Shevchenko
2022-06-03 16:18       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad3af033-97f1-3aad-d082-c6ed56185b59@metafoo.de \
    --to=lars@metafoo.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jbrunet@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=narmstrong@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).