Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Zhang Qilong <zhangqilong3@huawei.com>
Cc: <lars@metafoo.de>, <wens@csie.org>, <jernej.skrabec@gmail.com>,
	<samuel@sholland.org>, <linux-iio@vger.kernel.org>,
	<linux-sunxi@lists.linux.dev>
Subject: Re: [PATCH v2 1/2] iio: adc: sun4i-gpadc-iio: Fix PM disable depth imbalance in sun4i_gpadc_probe()
Date: Sun, 23 Oct 2022 13:31:34 +0100	[thread overview]
Message-ID: <20221023133134.3af0415c@jic23-huawei> (raw)
In-Reply-To: <20221020124045.77678-2-zhangqilong3@huawei.com>

On Thu, 20 Oct 2022 20:40:44 +0800
Zhang Qilong <zhangqilong3@huawei.com> wrote:

> The pm_runtime_enable will increase power disable depth.
> Thus a pairing decrement is needed on the error handling
> path to keep it balanced according to context. In addtion,
> the iio_map_array path has potentially been called.
> 
> We fix it by gotoing err_map when thermal_zone register
> failed.
> 
> Fixes: b0a242894f11 ("iio: adc: sun4i-gpadc-iio: register in the thermal after registering in pm")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
As mentioned in review of patch 2 there are other problems in here that
will probably be better cleaned up by taking the whole lot over
to devm

Thanks,

Jonathan

> ---
> v2:
> - revert iio_map_array if it's necessary when thermal_zone
>   register failed.
> ---
>  drivers/iio/adc/sun4i-gpadc-iio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/sun4i-gpadc-iio.c b/drivers/iio/adc/sun4i-gpadc-iio.c
> index a6ade70dedf8..d2535dd28af8 100644
> --- a/drivers/iio/adc/sun4i-gpadc-iio.c
> +++ b/drivers/iio/adc/sun4i-gpadc-iio.c
> @@ -648,7 +648,8 @@ static int sun4i_gpadc_probe(struct platform_device *pdev)
>  			dev_err(&pdev->dev,
>  				"could not register thermal sensor: %ld\n",
>  				PTR_ERR(info->tzd));
> -			return PTR_ERR(info->tzd);
> +			ret = PTR_ERR(info->tzd);
> +			goto err_map;
>  		}
>  	}
>  


  reply	other threads:[~2022-10-23 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 12:40 [PATCH v2 0/2] iio: adc: sun4i-gpadc-iio: Fix error handle in sun4i_gpadc_probe() Zhang Qilong
2022-10-20 12:40 ` [PATCH v2 1/2] iio: adc: sun4i-gpadc-iio: Fix PM disable depth imbalance " Zhang Qilong
2022-10-23 12:31   ` Jonathan Cameron [this message]
2022-10-20 12:40 ` [PATCH v2 2/2] iio: adc: sun4i-gpadc-iio: Fix error handle when devm_iio_device_register() failed " Zhang Qilong
2022-10-23 12:29   ` 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=20221023133134.3af0415c@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=samuel@sholland.org \
    --cc=wens@csie.org \
    --cc=zhangqilong3@huawei.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