linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] ata: sata_rcar: Handle return value of clk_prepare_enable
@ 2017-05-09 10:30 Arvind Yadav
  2017-05-09 14:31 ` Tejun Heo
  2017-05-10  9:02 ` Sergei Shtylyov
  0 siblings, 2 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-05-09 10:30 UTC (permalink / raw)
  To: tj; +Cc: linux-ide, linux-kernel

Here, Clock enable can failed. So adding an error check for
clk_prepare_enable.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/ata/sata_rcar.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 5d38245..7e789c1 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -890,7 +890,9 @@ static int sata_rcar_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev, "failed to get access to sata clock\n");
 		return PTR_ERR(priv->clk);
 	}
-	clk_prepare_enable(priv->clk);
+	ret = clk_prepare_enable(priv->clk);
+	if (ret)
+		return ret;
 
 	host = ata_host_alloc(&pdev->dev, 1);
 	if (!host) {
@@ -971,7 +973,9 @@ static int sata_rcar_resume(struct device *dev)
 	struct sata_rcar_priv *priv = host->private_data;
 	void __iomem *base = priv->base;
 
-	clk_prepare_enable(priv->clk);
+	int ret = clk_prepare_enable(priv->clk);
+	if (ret)
+		return ret;
 
 	/* ack and mask */
 	iowrite32(0, base + SATAINTSTAT_REG);
@@ -989,7 +993,9 @@ static int sata_rcar_restore(struct device *dev)
 	struct ata_host *host = dev_get_drvdata(dev);
 	struct sata_rcar_priv *priv = host->private_data;
 
-	clk_prepare_enable(priv->clk);
+	int ret = clk_prepare_enable(priv->clk);
+	if (ret)
+		return ret;
 
 	sata_rcar_setup_port(host);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] ata: sata_rcar: Handle return value of clk_prepare_enable
  2017-05-09 10:30 [PATCH v1] ata: sata_rcar: Handle return value of clk_prepare_enable Arvind Yadav
@ 2017-05-09 14:31 ` Tejun Heo
  2017-05-10  9:02 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2017-05-09 14:31 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: linux-ide, linux-kernel

On Tue, May 09, 2017 at 04:00:28PM +0530, Arvind Yadav wrote:
> Here, Clock enable can failed. So adding an error check for
> clk_prepare_enable.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

Applied to libata/for-4.12-fixes w/ a couple trivial changes.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] ata: sata_rcar: Handle return value of clk_prepare_enable
  2017-05-09 10:30 [PATCH v1] ata: sata_rcar: Handle return value of clk_prepare_enable Arvind Yadav
  2017-05-09 14:31 ` Tejun Heo
@ 2017-05-10  9:02 ` Sergei Shtylyov
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2017-05-10  9:02 UTC (permalink / raw)
  To: Arvind Yadav, tj; +Cc: linux-ide, linux-kernel

Hello.

On 5/9/2017 1:30 PM, Arvind Yadav wrote:

> Here, Clock enable can failed. So adding an error check for

    Maybe "here enabling the clock can fail"?

> clk_prepare_enable.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>

    Other than that:

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

MBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-10  9:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-09 10:30 [PATCH v1] ata: sata_rcar: Handle return value of clk_prepare_enable Arvind Yadav
2017-05-09 14:31 ` Tejun Heo
2017-05-10  9:02 ` Sergei Shtylyov

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).