diff options
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/Kconfig | 1 | ||||
-rw-r--r-- | drivers/rtc/class.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-abracon.c | 9 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds1307.c | 10 | ||||
-rw-r--r-- | drivers/rtc/rtc-imxdi.c | 15 | ||||
-rw-r--r-- | drivers/rtc/rtc-jz4740.c | 5 | ||||
-rw-r--r-- | drivers/rtc/rtc-pcf85363.c | 13 |
7 files changed, 24 insertions, 31 deletions
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig index db87aee1f3..98e58da89b 100644 --- a/drivers/rtc/Kconfig +++ b/drivers/rtc/Kconfig @@ -40,6 +40,7 @@ config RTC_DRV_ABRACON config RTC_DRV_PCF85363 tristate "NXP PCF85363" depends on I2C + select REGMAP_I2C help If you say yes here you get support for the PCF85363 RTC chip. diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 12751c8a3c..3edb294ed7 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -51,7 +51,7 @@ EXPORT_SYMBOL(rtc_set_time); int rtc_register(struct rtc_device *rtcdev) { - struct device_d *dev = &rtcdev->class_dev; + struct device *dev = &rtcdev->class_dev; if (!rtcdev->ops) return -EINVAL; diff --git a/drivers/rtc/rtc-abracon.c b/drivers/rtc/rtc-abracon.c index 6144fc0aa9..d43b1b4021 100644 --- a/drivers/rtc/rtc-abracon.c +++ b/drivers/rtc/rtc-abracon.c @@ -80,11 +80,10 @@ static const struct rtc_class_ops ds13xx_rtc_ops = { .set_time = abracon_set_time, }; -static int abracon_probe(struct device_d *dev) +static int abracon_probe(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct abracon *abracon; - int ret; abracon = xzalloc(sizeof(*abracon)); @@ -93,9 +92,7 @@ static int abracon_probe(struct device_d *dev) abracon->rtc.ops = &ds13xx_rtc_ops; abracon->rtc.dev = dev; - ret = rtc_register(&abracon->rtc); - - return ret; + return rtc_register(&abracon->rtc); }; static struct platform_device_id abracon_id[] = { @@ -103,7 +100,7 @@ static struct platform_device_id abracon_id[] = { { } }; -static struct driver_d abracon_driver = { +static struct driver abracon_driver = { .name = "rtc-abracon", .probe = abracon_probe, .id_table = abracon_id, diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index 314d794f11..e1a8e214d2 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -193,7 +193,7 @@ static inline struct ds1307 *to_ds1307_priv(struct rtc_device *rtcdev) static int ds1307_get_time(struct rtc_device *rtcdev, struct rtc_time *t) { - struct device_d *dev = rtcdev->dev; + struct device *dev = rtcdev->dev; struct ds1307 *ds1307 = to_ds1307_priv(rtcdev); int tmp; @@ -231,7 +231,7 @@ static int ds1307_get_time(struct rtc_device *rtcdev, struct rtc_time *t) static int ds1307_set_time(struct rtc_device *rtcdev, struct rtc_time *t) { - struct device_d *dev = rtcdev->dev; + struct device *dev = rtcdev->dev; struct ds1307 *ds1307 = to_ds1307_priv(rtcdev); int result; int tmp; @@ -280,7 +280,7 @@ static const struct rtc_class_ops ds13xx_rtc_ops = { .set_time = ds1307_set_time, }; -static int ds1307_probe(struct device_d *dev) +static int ds1307_probe(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct ds1307 *ds1307; @@ -288,7 +288,7 @@ static int ds1307_probe(struct device_d *dev) int tmp; unsigned char *buf; unsigned long driver_data; - const struct device_node *np = dev->device_node; + const struct device_node *np = dev->of_node; ds1307 = xzalloc(sizeof(struct ds1307)); @@ -481,7 +481,7 @@ exit: return err; } -static struct driver_d ds1307_driver = { +static struct driver ds1307_driver = { .name = "rtc-ds1307", .probe = ds1307_probe, .id_table = ds1307_id, diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c index 297fdc17b9..e9d68c6739 100644 --- a/drivers/rtc/rtc-imxdi.c +++ b/drivers/rtc/rtc-imxdi.c @@ -102,7 +102,7 @@ * @dsr: copy of the DSR register */ struct imxdi_dev { - struct device_d *dev; + struct device *dev; struct rtc_device rtc; void __iomem *ioaddr; struct clk *clk; @@ -529,20 +529,16 @@ static int nvstore_read(void *ctx, unsigned reg, void *val, size_t bytes) return 0; } -static struct nvmem_bus nvstore_nvmem_bus = { - .write = nvstore_write, - .read = nvstore_read, -}; - static struct nvmem_config nvstore_nvmem_config = { .name = "nvstore", .stride = 4, .word_size = 4, .size = 4, - .bus = &nvstore_nvmem_bus, + .reg_write = nvstore_write, + .reg_read = nvstore_read, }; -static int __init dryice_rtc_probe(struct device_d *dev) +static int __init dryice_rtc_probe(struct device *dev) { struct resource *res; struct imxdi_dev *imxdi; @@ -603,8 +599,9 @@ static __maybe_unused const struct of_device_id dryice_dt_ids[] = { { .compatible = "fsl,imx25-rtc" }, { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, dryice_dt_ids); -static struct driver_d dryice_rtc_driver = { +static struct driver dryice_rtc_driver = { .name = "imx-di-rtc", .probe = dryice_rtc_probe, .of_compatible = DRV_OF_COMPAT(dryice_dt_ids), diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c index 52f52349e6..aa79cb2ac5 100644 --- a/drivers/rtc/rtc-jz4740.c +++ b/drivers/rtc/rtc-jz4740.c @@ -106,7 +106,7 @@ static struct rtc_class_ops jz4740_rtc_ops = { .set_time = jz4740_rtc_set_time, }; -static int jz4740_rtc_probe(struct device_d *dev) +static int jz4740_rtc_probe(struct device *dev) { struct resource *iores; int ret; @@ -153,8 +153,9 @@ static __maybe_unused struct of_device_id jz4740_rtc_dt_ids[] = { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, jz4740_rtc_dt_ids); -static struct driver_d jz4740_rtc_driver = { +static struct driver jz4740_rtc_driver = { .name = "jz4740-rtc", .probe = jz4740_rtc_probe, .of_compatible = DRV_OF_COMPAT(jz4740_rtc_dt_ids), diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c index 7b785d6a77..bcc251e138 100644 --- a/drivers/rtc/rtc-pcf85363.c +++ b/drivers/rtc/rtc-pcf85363.c @@ -16,7 +16,7 @@ #include <malloc.h> #include <errno.h> #include <i2c/i2c.h> -#include <regmap.h> +#include <linux/regmap.h> #include <rtc.h> #include <linux/rtc.h> #include <linux/bcd.h> @@ -55,7 +55,7 @@ static inline struct pcf85363 *to_pcf85363_priv(struct rtc_device *rtcdev) static int pcf85363_rtc_read_time(struct rtc_device *rtcdev, struct rtc_time *tm) { - struct device_d *dev = rtcdev->dev; + struct device *dev = rtcdev->dev; struct pcf85363 *pcf85363 = to_pcf85363_priv(rtcdev); unsigned char buf[DT_YEARS + 1]; int ret, len = sizeof(buf); @@ -126,12 +126,11 @@ static const struct regmap_config pcf85363_regmap_i2c_config = { .max_register = 0x7f, }; -static int pcf85363_probe(struct device_d *dev) +static int pcf85363_probe(struct device *dev) { struct i2c_client *client = to_i2c_client(dev); struct pcf85363 *pcf85363; struct regmap *regmap; - int ret; regmap = regmap_init_i2c(client, &pcf85363_regmap_i2c_config); @@ -147,9 +146,7 @@ static int pcf85363_probe(struct device_d *dev) pcf85363->rtc.ops = &rtc_ops; pcf85363->rtc.dev = dev; - ret = rtc_register(&pcf85363->rtc); - - return ret; + return rtc_register(&pcf85363->rtc); } static struct platform_device_id dev_ids[] = { @@ -157,7 +154,7 @@ static struct platform_device_id dev_ids[] = { { /* sentinel */ } }; -static struct driver_d pcf85363_driver = { +static struct driver pcf85363_driver = { .name = "pcf85363", .probe = pcf85363_probe, .id_table = dev_ids, |