summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-17 16:53:25 -0400
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-05-17 16:55:16 -0400
commit52f0e7bc19fb1397aa9d29f87415f94d39bb8b01 (patch)
treee31fdcc3c01acd754666e78e64e7a4831b7ec939
parent180c92c4ae7c76329c990dc55dc3d422e7640527 (diff)
rtc: ls1x: switch to rtc_register_device
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--drivers/rtc/rtc-ls1x.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/rtc/rtc-ls1x.c b/drivers/rtc/rtc-ls1x.c
index de86f9fabc11..609bd1d013f0 100644
--- a/drivers/rtc/rtc-ls1x.c
+++ b/drivers/rtc/rtc-ls1x.c
@@ -173,15 +173,15 @@ static int ls1x_rtc_probe(struct platform_device *pdev)
173 while (readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TTS) 173 while (readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TTS)
174 usleep_range(1000, 3000); 174 usleep_range(1000, 3000);
175 175
176 rtcdev = devm_rtc_device_register(&pdev->dev, "ls1x-rtc", 176 rtcdev = devm_rtc_allocate_device(&pdev->dev);
177 &ls1x_rtc_ops , THIS_MODULE); 177 if (IS_ERR(rtcdev))
178 if (IS_ERR(rtcdev)) { 178 return PTR_ERR(rtcdev);
179 ret = PTR_ERR(rtcdev);
180 goto err;
181 }
182 179
183 platform_set_drvdata(pdev, rtcdev); 180 platform_set_drvdata(pdev, rtcdev);
184 return 0; 181 rtcdev->ops = &ls1x_rtc_ops;
182
183 return rtc_register_device(rtcdev);
184
185err: 185err:
186 return ret; 186 return ret;
187} 187}