diff mbox series

rtc: fix a missing check of clk_prepare

Message ID 20181226024333.72236-1-kjlu@umn.edu
State Accepted
Headers show
Series rtc: fix a missing check of clk_prepare | expand

Commit Message

Kangjie Lu Dec. 26, 2018, 2:43 a.m. UTC
clk_prepare() could fail, so let's check its status and if it fails
return its error code upstream.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/rtc/rtc-coh901331.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Linus Walleij Dec. 27, 2018, 9:43 a.m. UTC | #1
On Wed, Dec 26, 2018 at 3:44 AM Kangjie Lu <kjlu@umn.edu> wrote:

> clk_prepare() could fail, so let's check its status and if it fails
> return its error code upstream.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Alexandre Belloni Jan. 22, 2019, 6:02 p.m. UTC | #2
On 25/12/2018 20:43:33-0600, Kangjie Lu wrote:
> clk_prepare() could fail, so let's check its status and if it fails
> return its error code upstream.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>  drivers/rtc/rtc-coh901331.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c
index fc5cf5c44ae7..0b232c84f674 100644
--- a/drivers/rtc/rtc-coh901331.c
+++ b/drivers/rtc/rtc-coh901331.c
@@ -235,9 +235,13 @@  static int coh901331_suspend(struct device *dev)
 
 static int coh901331_resume(struct device *dev)
 {
+	int ret;
 	struct coh901331_port *rtap = dev_get_drvdata(dev);
 
-	clk_prepare(rtap->clk);
+	ret = clk_prepare(rtap->clk);
+	if (ret)
+		return ret;
+
 	if (device_may_wakeup(dev)) {
 		disable_irq_wake(rtap->irq);
 	} else {