mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 20:02:17 +00:00
rtc: ds1307: call rtc_nvmem_register()
Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
eed9d7a335
commit
e9fb7682fa
1 changed files with 6 additions and 6 deletions
|
@ -1696,6 +1696,11 @@ static int ds1307_probe(struct i2c_client *client,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ds1307->rtc->ops = chip->rtc_ops ?: &ds13xx_rtc_ops;
|
||||||
|
err = rtc_register_device(ds1307->rtc);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
if (chip->nvram_size) {
|
if (chip->nvram_size) {
|
||||||
ds1307->nvmem_cfg.name = "ds1307_nvram";
|
ds1307->nvmem_cfg.name = "ds1307_nvram";
|
||||||
ds1307->nvmem_cfg.word_size = 1;
|
ds1307->nvmem_cfg.word_size = 1;
|
||||||
|
@ -1705,15 +1710,10 @@ static int ds1307_probe(struct i2c_client *client,
|
||||||
ds1307->nvmem_cfg.reg_write = ds1307_nvram_write;
|
ds1307->nvmem_cfg.reg_write = ds1307_nvram_write;
|
||||||
ds1307->nvmem_cfg.priv = ds1307;
|
ds1307->nvmem_cfg.priv = ds1307;
|
||||||
|
|
||||||
ds1307->rtc->nvmem_config = &ds1307->nvmem_cfg;
|
|
||||||
ds1307->rtc->nvram_old_abi = true;
|
ds1307->rtc->nvram_old_abi = true;
|
||||||
|
rtc_nvmem_register(ds1307->rtc, &ds1307->nvmem_cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ds1307->rtc->ops = chip->rtc_ops ?: &ds13xx_rtc_ops;
|
|
||||||
err = rtc_register_device(ds1307->rtc);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
ds1307_hwmon_register(ds1307);
|
ds1307_hwmon_register(ds1307);
|
||||||
ds1307_clks_register(ds1307);
|
ds1307_clks_register(ds1307);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue