mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 19:56:07 +07:00
rtc: ds1305: switch to rtc_register_device
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
This commit is contained in:
parent
5b64a2965d
commit
6a4e89161e
@ -708,10 +708,15 @@ static int ds1305_probe(struct spi_device *spi)
|
||||
dev_dbg(&spi->dev, "AM/PM\n");
|
||||
|
||||
/* register RTC ... from here on, ds1305->ctrl needs locking */
|
||||
ds1305->rtc = devm_rtc_device_register(&spi->dev, "ds1305",
|
||||
&ds1305_ops, THIS_MODULE);
|
||||
ds1305->rtc = devm_rtc_allocate_device(&spi->dev);
|
||||
if (IS_ERR(ds1305->rtc)) {
|
||||
status = PTR_ERR(ds1305->rtc);
|
||||
return PTR_ERR(ds1305->rtc);
|
||||
}
|
||||
|
||||
ds1305->rtc->ops = &ds1305_ops;
|
||||
|
||||
status = rtc_register_device(ds1305->rtc);
|
||||
if (status) {
|
||||
dev_dbg(&spi->dev, "register rtc --> %d\n", status);
|
||||
return status;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user