From: Lars-Peter Clausen <lars@metafoo.de>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net,
michal.simek@xilinx.com, soren.brinkmann@xilinx.com
Cc: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2] iio: adc: xilinx: Fix error handling
Date: Tue, 21 Feb 2017 12:55:39 +0100 [thread overview]
Message-ID: <2c05b3bd-b5b4-e322-5d92-cd1c65d84ff5@metafoo.de> (raw)
In-Reply-To: <20170221063400.2984-1-christophe.jaillet@wanadoo.fr>
On 02/21/2017 07:34 AM, Christophe JAILLET wrote:
> Reorder error handling labels in order to match the way resources have
> been allocated.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Thanks.
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> v2: update goto label if 'xadc->ops->setup()' fails
> ---
> drivers/iio/adc/xilinx-xadc-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
> index 0a6beb3d99cb..515b91963db5 100644
> --- a/drivers/iio/adc/xilinx-xadc-core.c
> +++ b/drivers/iio/adc/xilinx-xadc-core.c
> @@ -1206,11 +1206,11 @@ static int xadc_probe(struct platform_device *pdev)
> }
> clk_prepare_enable(xadc->clk);
>
> ret = xadc->ops->setup(pdev, indio_dev, irq);
> if (ret)
> - goto err_free_samplerate_trigger;
> + goto err_clk_disable_unprepare;
>
> ret = request_irq(irq, xadc->ops->interrupt_handler, 0,
> dev_name(&pdev->dev), indio_dev);
> if (ret)
> goto err_clk_disable_unprepare;
> @@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev)
>
> err_free_irq:
> free_irq(irq, indio_dev);
> +err_clk_disable_unprepare:
> + clk_disable_unprepare(xadc->clk);
> err_free_samplerate_trigger:
> if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
> iio_trigger_free(xadc->samplerate_trigger);
> @@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
> err_triggered_buffer_cleanup:
> if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
> iio_triggered_buffer_cleanup(indio_dev);
> -err_clk_disable_unprepare:
> - clk_disable_unprepare(xadc->clk);
> err_device_free:
> kfree(indio_dev->channels);
>
>
next prev parent reply other threads:[~2017-02-21 11:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-21 6:34 Christophe JAILLET
2017-02-21 11:55 ` Lars-Peter Clausen [this message]
2017-02-25 16:41 ` 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=2c05b3bd-b5b4-e322-5d92-cd1c65d84ff5@metafoo.de \
--to=lars@metafoo.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=jic23@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=knaack.h@gmx.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=pmeerw@pmeerw.net \
--cc=soren.brinkmann@xilinx.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
all inboxes | Powered by JetHome®