drivers/rtc/rtc-stmp3xxx.c: check the return value from stmp_reset_block()
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 8 Jul 2013 23:00:45 +0000 (16:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Jul 2013 17:33:25 +0000 (10:33 -0700)
stmp_reset_block() 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>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/rtc/rtc-stmp3xxx.c

index 90a3e86..767fee2 100644 (file)
@@ -261,7 +261,12 @@ static int stmp3xxx_rtc_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, rtc_data);
 
-       stmp_reset_block(rtc_data->io);
+       err = stmp_reset_block(rtc_data->io);
+       if (err) {
+               dev_err(&pdev->dev, "stmp_reset_block failed: %d\n", err);
+               return err;
+       }
+
        writel(STMP3XXX_RTC_PERSISTENT0_ALARM_EN |
                        STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE_EN |
                        STMP3XXX_RTC_PERSISTENT0_ALARM_WAKE,