rtc: mrst: fix error code in probe()

Message ID 20180612120302.kprwknomakzg7bdn@kili.mountain
State New
Headers show
  • rtc: mrst: fix error code in probe()
Related show

Commit Message

Dan Carpenter June 12, 2018, 12:03 p.m.
We should be returning "retval".  The "mrst_rtc.rtc" variable is a valid

Fixes: 32b41f93dcaf ("rtc: mrst: switch to devm functions")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>


diff --git a/drivers/rtc/rtc-mrst.c b/drivers/rtc/rtc-mrst.c
index 097a4d4e2aba..1925aaf09093 100644
--- a/drivers/rtc/rtc-mrst.c
+++ b/drivers/rtc/rtc-mrst.c
@@ -367,10 +367,8 @@  static int vrtc_mrst_do_probe(struct device *dev, struct resource *iomem,
 	retval = rtc_register_device(mrst_rtc.rtc);
-	if (retval) {
-		retval = PTR_ERR(mrst_rtc.rtc);
+	if (retval)
 		goto cleanup0;
-	}
 	dev_dbg(dev, "initialised\n");
 	return 0;