diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-05-17 23:33:25 +0300 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-05-17 23:37:12 +0300 |
commit | b8157168207db81f7f65a6e54675272c31868af5 (patch) | |
tree | bcfb953d0a78c327c9422ad3045890df206479d3 /drivers/rtc | |
parent | 57ad9e69251177843fd6673eb1d7085e9cf39989 (diff) | |
download | linux-b8157168207db81f7f65a6e54675272c31868af5.tar.xz |
rtc: rx8581: switch to rtc_register_device
This allows for future improvement of the driver.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-rx8581.c | 13 |
1 files 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[] = { |