mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/7] rtc: rx8581: switch to rtc_register_device
@ 2018-05-17 20:33 Alexandre Belloni
  2018-05-17 20:33 ` [PATCH 2/7] rtc: rx8581: add RTC range Alexandre Belloni
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Alexandre Belloni @ 2018-05-17 20:33 UTC (permalink / raw)
  To: linux-rtc; +Cc: linux-kernel, Alexandre Belloni

This allows for future improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/rtc/rtc-rx8581.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/rtc/rtc-rx8581.c b/drivers/rtc/rtc-rx8581.c
index 32caadf912ca..c64911a08531 100644
--- a/drivers/rtc/rtc-rx8581.c
+++ b/drivers/rtc/rtc-rx8581.c
@@ -286,16 +286,13 @@ static int rx8581_probe(struct i2c_client *client,
 		rx8581->write_block_data = rx8581_write_block_data;
 	}
 
-	rx8581->rtc = devm_rtc_device_register(&client->dev,
-		rx8581_driver.driver.name, &rx8581_rtc_ops, THIS_MODULE);
-
-	if (IS_ERR(rx8581->rtc)) {
-		dev_err(&client->dev,
-			"unable to register the class device\n");
+	rx8581->rtc = devm_rtc_allocate_device(&client->dev);
+	if (IS_ERR(rx8581->rtc))
 		return PTR_ERR(rx8581->rtc);
-	}
 
-	return 0;
+	rx8581->rtc->ops = &rx8581_rtc_ops;
+
+	return rtc_register_device(rx8581->rtc);
 }
 
 static const struct i2c_device_id rx8581_id[] = {
-- 
2.17.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-05-17 20:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-17 20:33 [PATCH 1/7] rtc: rx8581: switch to rtc_register_device Alexandre Belloni
2018-05-17 20:33 ` [PATCH 2/7] rtc: rx8581: add RTC range Alexandre Belloni
2018-05-17 20:33 ` [PATCH 3/7] rtc: rx8581: let the core handle rtc range Alexandre Belloni
2018-05-17 20:33 ` [PATCH 4/7] rtc: rx8581: remove useless indirection Alexandre Belloni
2018-05-17 20:33 ` [PATCH 5/7] rtc: rx8581: remove useless declaration Alexandre Belloni
2018-05-17 20:33 ` [PATCH 6/7] rtc: rx8581: error out when time invalid Alexandre Belloni
2018-05-17 20:33 ` [PATCH 7/7] rtc: rx8581: switch to regmap Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®