* [PATCH 1/2] rtc: rtc-mxc: Remove unneeded label
@ 2013-12-02 3:13 Fabio Estevam
2013-12-02 3:13 ` [PATCH 2/2] rtc: rtc-mxc: Check the return value from clk_prepare_enable() Fabio Estevam
0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2013-12-02 3:13 UTC (permalink / raw)
To: akpm; +Cc: a.zummo, s.hauer, linux-kernel, Fabio Estevam
From: Fabio Estevam <fabio.estevam@freescale.com>
There is no need to jump to the 'exit_free_pdata' label when devm_clk_get()
fails, as we can directly return the error and simplify the code a bit.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/rtc/rtc-mxc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 50c5726..a3ed1cf 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -391,8 +391,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
pdata->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pdata->clk)) {
dev_err(&pdev->dev, "unable to get clock!\n");
- ret = PTR_ERR(pdata->clk);
- goto exit_free_pdata;
+ return PTR_ERR(pdata->clk);
}
clk_prepare_enable(pdata->clk);
@@ -447,8 +446,6 @@ static int mxc_rtc_probe(struct platform_device *pdev)
exit_put_clk:
clk_disable_unprepare(pdata->clk);
-exit_free_pdata:
-
return ret;
}
--
1.8.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] rtc: rtc-mxc: Check the return value from clk_prepare_enable()
2013-12-02 3:13 [PATCH 1/2] rtc: rtc-mxc: Remove unneeded label Fabio Estevam
@ 2013-12-02 3:13 ` Fabio Estevam
0 siblings, 0 replies; 2+ messages in thread
From: Fabio Estevam @ 2013-12-02 3:13 UTC (permalink / raw)
To: akpm; +Cc: a.zummo, s.hauer, linux-kernel, Fabio Estevam
From: Fabio Estevam <fabio.estevam@freescale.com>
clk_prepare_enable() may fail, so let's check its return value and propagate it
in the case of error.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/rtc/rtc-mxc.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index a3ed1cf..419874f 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -394,7 +394,10 @@ static int mxc_rtc_probe(struct platform_device *pdev)
return PTR_ERR(pdata->clk);
}
- clk_prepare_enable(pdata->clk);
+ ret = clk_prepare_enable(pdata->clk);
+ if (ret)
+ return ret;
+
rate = clk_get_rate(pdata->clk);
if (rate == 32768)
--
1.8.1.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-02 3:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-02 3:13 [PATCH 1/2] rtc: rtc-mxc: Remove unneeded label Fabio Estevam
2013-12-02 3:13 ` [PATCH 2/2] rtc: rtc-mxc: Check the return value from clk_prepare_enable() Fabio Estevam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox