diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2018-11-21 13:58:38 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2018-11-21 13:58:38 +1100 |
commit | 396dfac117b3061c3056621e734e9efbdceb70a8 (patch) | |
tree | 1504a3f96d072a103466d760b3d64522591def85 /drivers | |
parent | 7f2e89646623bcbd0f20a60f3ab10d9cf3184f71 (diff) | |
parent | b28cc6cec3d814f5184cbebb2d1f987e769f534a (diff) |
Merge remote-tracking branch 'rtc/rtc-next'
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/class.c | 26 | ||||
-rw-r--r-- | drivers/rtc/rtc-ep93xx.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-m41t80.c | 15 | ||||
-rw-r--r-- | drivers/rtc/rtc-max6916.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-max77686.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-omap.c | 4 | ||||
-rw-r--r-- | drivers/rtc/rtc-rk808.c | 2 | ||||
-rw-r--r-- | drivers/rtc/rtc-s3c.c | 6 | ||||
-rw-r--r-- | drivers/rtc/rtc-sh.c | 7 |
9 files changed, 16 insertions, 50 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 3b43787f154b..6d364085bd86 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -380,13 +380,6 @@ static void devm_rtc_device_release(struct device *dev, void *res) rtc_device_unregister(rtc); } -static int devm_rtc_device_match(struct device *dev, void *res, void *data) -{ - struct rtc **r = res; - - return *r == data; -} - /** * devm_rtc_device_register - resource managed rtc_device_register() * @dev: the device to register @@ -424,25 +417,6 @@ struct rtc_device *devm_rtc_device_register(struct device *dev, } EXPORT_SYMBOL_GPL(devm_rtc_device_register); -/** - * devm_rtc_device_unregister - resource managed devm_rtc_device_unregister() - * @dev: the device to unregister - * @rtc: the RTC class device to unregister - * - * Deallocated a rtc allocated with devm_rtc_device_register(). Normally this - * function will not need to be called and the resource management code will - * ensure that the resource is freed. - */ -void devm_rtc_device_unregister(struct device *dev, struct rtc_device *rtc) -{ - int rc; - - rc = devres_release(dev, devm_rtc_device_release, - devm_rtc_device_match, rtc); - WARN_ON(rc); -} -EXPORT_SYMBOL_GPL(devm_rtc_device_unregister); - static void devm_rtc_release_device(struct device *dev, void *res) { struct rtc_device *rtc = *(struct rtc_device **)res; diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c index 694038208745..1932a4f861d1 100644 --- a/drivers/rtc/rtc-ep93xx.c +++ b/drivers/rtc/rtc-ep93xx.c @@ -61,7 +61,7 @@ static int ep93xx_rtc_read_time(struct device *dev, struct rtc_time *tm) struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev); unsigned long time; - time = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA); + time = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA); rtc_time_to_tm(time, tm); return 0; diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index a3fb235fea0d..a39138932379 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -217,7 +217,7 @@ static int m41t80_rtc_read_time(struct device *dev, struct rtc_time *tm) sizeof(buf), buf); if (err < 0) { dev_err(&client->dev, "Unable to read date\n"); - return -EIO; + return err; } tm->tm_sec = bcd2bin(buf[M41T80_REG_SEC] & 0x7f); @@ -274,10 +274,11 @@ static int m41t80_rtc_set_time(struct device *dev, struct rtc_time *tm) if (flags < 0) return flags; - if (i2c_smbus_write_byte_data(client, M41T80_REG_FLAGS, - flags & ~M41T80_FLAGS_OF)) { + err = i2c_smbus_write_byte_data(client, M41T80_REG_FLAGS, + flags & ~M41T80_FLAGS_OF); + if (err < 0) { dev_err(&client->dev, "Unable to write flags register\n"); - return -EIO; + return err; } return err; @@ -287,10 +288,12 @@ static int m41t80_rtc_proc(struct device *dev, struct seq_file *seq) { struct i2c_client *client = to_i2c_client(dev); struct m41t80_data *clientdata = i2c_get_clientdata(client); - u8 reg; + int reg; if (clientdata->features & M41T80_FEATURE_BL) { reg = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS); + if (reg < 0) + return reg; seq_printf(seq, "battery\t\t: %s\n", (reg & M41T80_FLAGS_BATT_LOW) ? "exhausted" : "ok"); } @@ -393,7 +396,7 @@ static int m41t80_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) alrm->time.tm_min = bcd2bin(alarmvals[3] & 0x7f); alrm->time.tm_hour = bcd2bin(alarmvals[2] & 0x3f); alrm->time.tm_mday = bcd2bin(alarmvals[1] & 0x3f); - alrm->time.tm_mon = bcd2bin(alarmvals[0] & 0x3f); + alrm->time.tm_mon = bcd2bin(alarmvals[0] & 0x3f) - 1; alrm->enabled = !!(alarmvals[0] & M41T80_ALMON_AFE); alrm->pending = (flags & M41T80_FLAGS_AF) && alrm->enabled; diff --git a/drivers/rtc/rtc-max6916.c b/drivers/rtc/rtc-max6916.c index 7e908a490cf6..9d4b407cc4b8 100644 --- a/drivers/rtc/rtc-max6916.c +++ b/drivers/rtc/rtc-max6916.c @@ -86,7 +86,7 @@ static int max6916_set_time(struct device *dev, struct rtc_time *dt) if (dt->tm_year < 100 || dt->tm_year > 199) { dev_err(&spi->dev, "Year must be between 2000 and 2099. It's %d.\n", dt->tm_year + 1900); - return -EINVAL; + return -EINVAL; } buf[0] = MAX6916_CLOCK_BURST & 0x7F; diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c index 8a60900d6b8b..4aff349ae301 100644 --- a/drivers/rtc/rtc-max77686.c +++ b/drivers/rtc/rtc-max77686.c @@ -360,7 +360,7 @@ static int max77686_rtc_read_time(struct device *dev, struct rtc_time *tm) out: mutex_unlock(&info->lock); - return 0; + return ret; } static int max77686_rtc_set_time(struct device *dev, struct rtc_time *tm) diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c index 320b4a520eb3..bbff0e2deb84 100644 --- a/drivers/rtc/rtc-omap.c +++ b/drivers/rtc/rtc-omap.c @@ -566,9 +566,7 @@ static const struct pinctrl_ops rtc_pinctrl_ops = { .dt_free_map = pinconf_generic_dt_free_map, }; -enum rtc_pin_config_param { - PIN_CONFIG_ACTIVE_HIGH = PIN_CONFIG_END + 1, -}; +#define PIN_CONFIG_ACTIVE_HIGH (PIN_CONFIG_END + 1) static const struct pinconf_generic_params rtc_params[] = { {"ti,active-high", PIN_CONFIG_ACTIVE_HIGH, 0}, diff --git a/drivers/rtc/rtc-rk808.c b/drivers/rtc/rtc-rk808.c index 739c0d42e835..b2f9e45e0298 100644 --- a/drivers/rtc/rtc-rk808.c +++ b/drivers/rtc/rtc-rk808.c @@ -400,7 +400,7 @@ static int rk808_rtc_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "Failed to write RTC status: %d\n", ret); - return ret; + return ret; } device_init_wakeup(&pdev->dev, 1); diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 75c8c5033e08..58e03ac3578b 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c @@ -327,7 +327,6 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) struct rtc_time *tm = &alrm->time; unsigned int alrm_en; int ret; - int year = tm->tm_year - 100; dev_dbg(dev, "s3c_rtc_setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n", alrm->enabled, @@ -356,11 +355,6 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) writeb(bin2bcd(tm->tm_hour), info->base + S3C2410_ALMHOUR); } - if (year < 100 && year >= 0) { - alrm_en |= S3C2410_RTCALM_YEAREN; - writeb(bin2bcd(year), info->base + S3C2410_ALMYEAR); - } - if (tm->tm_mon < 12 && tm->tm_mon >= 0) { alrm_en |= S3C2410_RTCALM_MONEN; writeb(bin2bcd(tm->tm_mon + 1), info->base + S3C2410_ALMMON); diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index 51ba414798a8..d417b203cbc5 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * SuperH On-Chip RTC Support * @@ -9,10 +10,6 @@ * * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org> * Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. */ #include <linux/module.h> #include <linux/mod_devicetable.h> @@ -681,5 +678,5 @@ MODULE_DESCRIPTION("SuperH on-chip RTC driver"); MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>, " "Jamie Lenehan <lenehan@twibble.org>, " "Angelo Castello <angelo.castello@st.com>"); -MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:" DRV_NAME); |