All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
	linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-kernel@vger.kernel.org
Subject: [rtc-linux] Re: [PATCH 1/5] rtc: at91sam9: properly handle error case
Date: Thu, 30 Jul 2015 11:28:52 +0200	[thread overview]
Message-ID: <20150730112852.79dcb30a@bbrezillon> (raw)
In-Reply-To: <1438215872-27794-1-git-send-email-alexandre.belloni@free-electrons.com>

On Thu, 30 Jul 2015 02:24:28 +0200
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:

> In case of a probe error, it is possible to abort after issuing
> clk_prepare_enable(). Ensure the clock is disabled and unprepared in that
> case.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

To the whole series:

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/rtc/rtc-at91sam9.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index 5ccaee32df72..152cd816cc43 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -451,8 +451,10 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  
>  	rtc->rtcdev = devm_rtc_device_register(&pdev->dev, pdev->name,
>  					&at91_rtc_ops, THIS_MODULE);
> -	if (IS_ERR(rtc->rtcdev))
> -		return PTR_ERR(rtc->rtcdev);
> +	if (IS_ERR(rtc->rtcdev)) {
> +		ret = PTR_ERR(rtc->rtcdev);
> +		goto err_clk;
> +	}
>  
>  	/* register irq handler after we know what name we'll use */
>  	ret = devm_request_irq(&pdev->dev, rtc->irq, at91_rtc_interrupt,
> @@ -460,7 +462,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  			       dev_name(&rtc->rtcdev->dev), rtc);
>  	if (ret) {
>  		dev_dbg(&pdev->dev, "can't share IRQ %d?\n", rtc->irq);
> -		return ret;
> +		goto err_clk;
>  	}
>  
>  	/* NOTE:  sam9260 rev A silicon has a ROM bug which resets the
> @@ -474,6 +476,11 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  				dev_name(&rtc->rtcdev->dev));
>  
>  	return 0;
> +
> +err_clk:
> +	clk_disable_unprepare(rtc->sclk);
> +
> +	return ret;
>  }
>  
>  /*



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: boris.brezillon@free-electrons.com (Boris Brezillon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] rtc: at91sam9: properly handle error case
Date: Thu, 30 Jul 2015 11:28:52 +0200	[thread overview]
Message-ID: <20150730112852.79dcb30a@bbrezillon> (raw)
In-Reply-To: <1438215872-27794-1-git-send-email-alexandre.belloni@free-electrons.com>

On Thu, 30 Jul 2015 02:24:28 +0200
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:

> In case of a probe error, it is possible to abort after issuing
> clk_prepare_enable(). Ensure the clock is disabled and unprepared in that
> case.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

To the whole series:

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/rtc/rtc-at91sam9.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index 5ccaee32df72..152cd816cc43 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -451,8 +451,10 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  
>  	rtc->rtcdev = devm_rtc_device_register(&pdev->dev, pdev->name,
>  					&at91_rtc_ops, THIS_MODULE);
> -	if (IS_ERR(rtc->rtcdev))
> -		return PTR_ERR(rtc->rtcdev);
> +	if (IS_ERR(rtc->rtcdev)) {
> +		ret = PTR_ERR(rtc->rtcdev);
> +		goto err_clk;
> +	}
>  
>  	/* register irq handler after we know what name we'll use */
>  	ret = devm_request_irq(&pdev->dev, rtc->irq, at91_rtc_interrupt,
> @@ -460,7 +462,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  			       dev_name(&rtc->rtcdev->dev), rtc);
>  	if (ret) {
>  		dev_dbg(&pdev->dev, "can't share IRQ %d?\n", rtc->irq);
> -		return ret;
> +		goto err_clk;
>  	}
>  
>  	/* NOTE:  sam9260 rev A silicon has a ROM bug which resets the
> @@ -474,6 +476,11 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  				dev_name(&rtc->rtcdev->dev));
>  
>  	return 0;
> +
> +err_clk:
> +	clk_disable_unprepare(rtc->sclk);
> +
> +	return ret;
>  }
>  
>  /*



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>,
	linux-arm-kernel@lists.infradead.org, rtc-linux@googlegroups.com,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] rtc: at91sam9: properly handle error case
Date: Thu, 30 Jul 2015 11:28:52 +0200	[thread overview]
Message-ID: <20150730112852.79dcb30a@bbrezillon> (raw)
In-Reply-To: <1438215872-27794-1-git-send-email-alexandre.belloni@free-electrons.com>

On Thu, 30 Jul 2015 02:24:28 +0200
Alexandre Belloni <alexandre.belloni@free-electrons.com> wrote:

> In case of a probe error, it is possible to abort after issuing
> clk_prepare_enable(). Ensure the clock is disabled and unprepared in that
> case.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>

To the whole series:

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/rtc/rtc-at91sam9.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
> index 5ccaee32df72..152cd816cc43 100644
> --- a/drivers/rtc/rtc-at91sam9.c
> +++ b/drivers/rtc/rtc-at91sam9.c
> @@ -451,8 +451,10 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  
>  	rtc->rtcdev = devm_rtc_device_register(&pdev->dev, pdev->name,
>  					&at91_rtc_ops, THIS_MODULE);
> -	if (IS_ERR(rtc->rtcdev))
> -		return PTR_ERR(rtc->rtcdev);
> +	if (IS_ERR(rtc->rtcdev)) {
> +		ret = PTR_ERR(rtc->rtcdev);
> +		goto err_clk;
> +	}
>  
>  	/* register irq handler after we know what name we'll use */
>  	ret = devm_request_irq(&pdev->dev, rtc->irq, at91_rtc_interrupt,
> @@ -460,7 +462,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  			       dev_name(&rtc->rtcdev->dev), rtc);
>  	if (ret) {
>  		dev_dbg(&pdev->dev, "can't share IRQ %d?\n", rtc->irq);
> -		return ret;
> +		goto err_clk;
>  	}
>  
>  	/* NOTE:  sam9260 rev A silicon has a ROM bug which resets the
> @@ -474,6 +476,11 @@ static int at91_rtc_probe(struct platform_device *pdev)
>  				dev_name(&rtc->rtcdev->dev));
>  
>  	return 0;
> +
> +err_clk:
> +	clk_disable_unprepare(rtc->sclk);
> +
> +	return ret;
>  }
>  
>  /*



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  parent reply	other threads:[~2015-07-30  9:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30  0:24 [rtc-linux] [PATCH 1/5] rtc: at91sam9: properly handle error case Alexandre Belloni
2015-07-30  0:24 ` Alexandre Belloni
2015-07-30  0:24 ` Alexandre Belloni
2015-07-30  0:24 ` [rtc-linux] [PATCH 2/5] rtc: at91sam9: remove useless check Alexandre Belloni
2015-07-30  0:24   ` Alexandre Belloni
2015-07-30  0:24   ` Alexandre Belloni
2015-07-30  0:24 ` [rtc-linux] [PATCH 3/5] rtc: at91sam9: sort headers alphabetically Alexandre Belloni
2015-07-30  0:24   ` Alexandre Belloni
2015-07-30  0:24   ` Alexandre Belloni
2015-07-30  0:24 ` [rtc-linux] [PATCH 4/5] rtc: at91sam9: get sclk rate after enabling it Alexandre Belloni
2015-07-30  0:24   ` Alexandre Belloni
2015-07-30  0:24   ` Alexandre Belloni
2015-07-30  0:24 ` [rtc-linux] [PATCH 5/5] rtc: at91rm9200: sort headers alphabetically Alexandre Belloni
2015-07-30  0:24   ` Alexandre Belloni
2015-07-30  0:24   ` Alexandre Belloni
2015-07-30  9:28 ` Boris Brezillon [this message]
2015-07-30  9:28   ` [PATCH 1/5] rtc: at91sam9: properly handle error case Boris Brezillon
2015-07-30  9:28   ` Boris Brezillon
2015-07-30  9:57 ` [rtc-linux] " Nicolas Ferre
2015-07-30  9:57   ` Nicolas Ferre
2015-07-30  9:57   ` Nicolas Ferre

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=20150730112852.79dcb30a@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=rtc-linux@googlegroups.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.