summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* rtc: pm8xxx: remove useless messageAlexandre Belloni2018-03-021-6/+0
| | | | | | | It is not necessary to print a message when the time is invalid as userspace will already get an error (and an optional dev_dbg message). Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: abx80x: remove useless messageAlexandre Belloni2018-03-021-5/+1
| | | | | | | It is not necessary to print a message when the time is invalid as userspace will already get an error (and an optional dev_dbg message). Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: tegra: stop validating rtc_time in .set_timeAlexandre Belloni2018-03-021-4/+0
| | | | | | | The RTC core is always validating the rtc_time struct before calling .set_time. It is not necessary to do it again in .set_time. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: spear: stop validating rtc_time in .set_time and .set_alarmAlexandre Belloni2018-03-021-9/+3
| | | | | | | The RTC core is always validating the rtc_time struct before calling .set_time or .set_alarm. It is not necessary to do it again. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: omap: stop validating rtc_time in .set_time and .set_alarmAlexandre Belloni2018-03-021-3/+0
| | | | | | | | | The RTC core is always validating the rtc_time struct before calling .set_time or .set_alarm. It is not necessary to do it again. Also, rtc_time_to_tm never generates an invalid rtc_tm (it can be out of range though). Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: max77686: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-021-3/+1
| | | | | | | The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it just before returning from the callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: m41t93: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-021-1/+1
| | | | | | | The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it just before returning from the callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: isl12022: remove useless indirectionAlexandre Belloni2018-03-021-12/+4
| | | | | | | isl12022_get_datetime and isl12022_set_datetime are only used after casting dev to an i2c_client. Remove that useless indirection. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: sc27xx: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-021-1/+1
| | | | | | | | | rtc_time64_to_tm never generates an invalid tm. It is not necessary to validate it. Also, the RTC core is always calling rtc_valid_tm after the read_time callback. Reviewed-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: r7301: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-021-1/+1
| | | | | | | The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it just before returning from the callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: nuc900: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-021-6/+8
| | | | | | | The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it before returning from the callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: diasemi: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-023-4/+3
| | | | | | | | The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it before returning from the callback. Acked-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: cpcap: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-021-1/+1
| | | | | | | | The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it just before returning from the callback. Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ab-b5ze-s3: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-021-3/+1
| | | | | | | The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it just before returning from the callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stop validating rtc_time in .read_timeAlexandre Belloni2018-03-0248-53/+48
| | | | | | | The RTC core is always calling rtc_valid_tm after the read_time callback. It is not necessary to call it just before returning from the callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stop validating rtc_time after rtc_time_to_tmAlexandre Belloni2018-03-0113-13/+13
| | | | | | | rtc_time_to_tm never generates an invalid tm. It is not necessary to validate it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stop validating rtc_time after rtc_time64_to_tmAlexandre Belloni2018-03-013-3/+3
| | | | | | | rtc_time64_to_tm never generates an invalid tm. It is not necessary to validate it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stk17ta8: let the core handle invalid timeAlexandre Belloni2018-03-011-4/+0
| | | | | | | | Returning a valid time when the time is invalid is a bad practice, because then userspace is not able to react on the information. Also, it doesn't make sense to return epoch because it is already the default time. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: rs5c348: let the core handle invalid timeAlexandre Belloni2018-03-011-5/+0
| | | | | | | | Returning a valid time when the time is invalid is a bad practice, because then userspace is not able to react on the information. Also, it doesn't make sense to return epoch because it is already the default time. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: cmos: let the core handle invalid timeAlexandre Belloni2018-03-011-12/+0
| | | | | | | Setting the rtc to a valid time when the time is invalid is a bad practice, because then userspace doesn't know it shouldn't trust the RTC. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1553: let the core handle invalid timeAlexandre Belloni2018-03-011-4/+0
| | | | | | | | Returning a valid time when the time is invalid is a bad practice, because then userspace is not able to react on the information. Also, it doesn't make sense to return epoch because it is already the default time. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1511: let the core handle invalid timeAlexandre Belloni2018-03-011-4/+0
| | | | | | | | Returning a valid time when the time is invalid is a bad practice, because then userspace is not able to react on the information. Also, it doesn't make sense to return epoch because it is already the default time. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: tx4939: avoid unintended sign extension on a 24 bit shiftColin Ian King2018-03-011-2/+4
| | | | | | | | | | | | | | The shifting of buf[5] by 24 bits to the left will be promoted to a 32 bit signed int and then sign-extended to an unsigned long. If the top bit of buf[5] is set then all then all the upper bits sec end up as also being set because of the sign-extension. Fix this by casting buf[5] to an unsigned long before the shift. Detected by CoverityScan, CID#1465292 ("Unintended sign extension") Fixes: 0e1492330cd2 ("rtc: add rtc-tx4939 driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* MAINTAINERS: rtc: update my email addressAlexandre Belloni2018-03-011-1/+1
| | | | | | Free Electrons is now Bootlin. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* char: rtc: remove unused rtc_control() APIAlexandre Belloni2018-03-012-87/+0
| | | | | | | | | | Since commit 34ce71a96dcb ("ALSA: timer: remove legacy rtctimer"), the rtc_register/rtc_control/rtc_unregister API is unused. As it is highly unlikely to be needed again, remove it. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: mxc_v2: Fix _iomem pointer notationFabio Estevam2018-03-011-1/+1
| | | | | | | | | | | | | | | | | | Fix the iomem pointer notation in order to fix the following sparse warnings: drivers/rtc/rtc-mxc_v2.c:280:18: warning: incorrect type in argument 1 (different address spaces) drivers/rtc/rtc-mxc_v2.c:280:18: expected void const volatile [noderef] <asn:2>*addr drivers/rtc/rtc-mxc_v2.c:280:18: got void *[noderef] <asn:2>ioaddr drivers/rtc/rtc-mxc_v2.c:329:44: warning: incorrect type in argument 1 (different address spaces) drivers/rtc/rtc-mxc_v2.c:329:44: expected void *[noderef] <asn:2>ioaddr drivers/rtc/rtc-mxc_v2.c:329:44: got void [noderef] <asn:2>* drivers/rtc/rtc-mxc_v2.c:339:44: warning: incorrect type in argument 1 (different address spaces) drivers/rtc/rtc-mxc_v2.c:339:44: expected void *[noderef] <asn:2>ioaddr drivers/rtc/rtc-mxc_v2.c:339:44: got void [noderef] <asn:2>* Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: isl1208: Fix unintended clear of SR bitsDenis Osterland2018-03-011-0/+5
| | | | | | | | | | | | | | | | | | After successful sr = isl1208_i2c_set_regs(client, 0, regs, ISL1208_RTC_SECTION_LEN); sr will be 0. As a result sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, sr & ~ISL1208_REG_SR_WRTC); is equal to sr = i2c_smbus_write_byte_data(client, ISL1208_REG_SR, 0); which clears all flags in SR. Add an additional read of SR, to have value of SR in sr again. Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: tx4939: use generic nvmemAlexandre Belloni2018-03-011-33/+26
| | | | | | | Instead of adding a binary sysfs attribute from the driver, use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: tx4939: fix possible race conditionAlexandre Belloni2018-03-011-2/+3
| | | | | | | The probe function is not allowed to fail after registering the RTC. Call rtc_register_device() at the end. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: tx4939: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+8
| | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: tx4939: extend test coverageAlexandre Belloni2018-03-011-1/+1
| | | | | | | The rtc-tx4939 driver now compiles correctly on other architectures, add COMPILE_TEST to improve code coverage. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: tx4939: remove arch/mips dependencyAlexandre Belloni2018-03-011-1/+24
| | | | | | | Copy RTC definitions from arch/mips/include/asm/txx9/tx4939.h to the RTC driver so it doesn't depend on arch/mips anymore. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stk17ta8: use generic nvmemAlexandre Belloni2018-03-011-40/+24
| | | | | | | Instead of adding a binary sysfs attribute from the driver, use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stk17ta8: fix possible race conditionAlexandre Belloni2018-03-011-2/+2
| | | | | | | The probe function is not allowed to fail after registering the RTC. Call rtc_register_device() at the end. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stk17ta8: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+7
| | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stk17ta8: make alarms usefulAlexandre Belloni2018-03-011-4/+1
| | | | | | | | Currently, the IRQs are disabled when the rtc driver is removed (e.g. when shutting down the platform). This means that the RTC will be unable to wakeup the platform. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: rp5c01: use generic nvmemAlexandre Belloni2018-03-011-41/+24
| | | | | | | Instead of adding a binary sysfs attribute from the driver, use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: rp5c01: fix possible race conditionAlexandre Belloni2018-03-011-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The probe function is not allowed to fail after registering the RTC because the following may happen: CPU0: CPU1: sys_load_module() do_init_module() do_one_initcall() cmos_do_probe() rtc_device_register() __register_chrdev() cdev->owner = struct module* open("/dev/rtc0") rtc_device_unregister() module_put() free_module() module_free(mod->module_core) /* struct module *module is now freed */ chrdev_open() spin_lock(cdev_lock) cdev_get() try_module_get() module_is_live() /* dereferences already freed struct module* */ Switch to devm_rtc_allocate_device/rtc_register_device to register the rtc as late as possible. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1742: use generic nvmemAlexandre Belloni2018-03-011-41/+26
| | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1742: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+8
| | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: cmos: use generic nvmemAlexandre Belloni2018-03-011-43/+30
| | | | | | | | Instead of adding a binary sysfs attribute from the driver, use the core to register an nvmem device. This allows to use the in-kernel interface to access the nvram. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: cmos: fix possible race conditionAlexandre Belloni2018-03-011-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The probe function is not allowed to fail after registering the RTC because the following may happen: CPU0: CPU1: sys_load_module() do_init_module() do_one_initcall() cmos_do_probe() rtc_device_register() __register_chrdev() cdev->owner = struct module* open("/dev/rtc0") rtc_device_unregister() module_put() free_module() module_free(mod->module_core) /* struct module *module is now freed */ chrdev_open() spin_lock(cdev_lock) cdev_get() try_module_get() module_is_live() /* dereferences already freed struct module* */ Switch to devm_rtc_allocate_device/rtc_register_device to register the rtc as late as possible. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1553: make alarms usefulAlexandre Belloni2018-03-011-10/+0
| | | | | | | | Currently, the IRQs are disabled when the rtc driver is removed (e.g. when shutting down the platform). This means that the RTC will be unable to wakeup the platform. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1553: use generic nvmemAlexandre Belloni2018-03-011-31/+24
| | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1553: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+7
| | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: sirfsoc: remove useless sirfsoc_rtc_ioctlAlexandre Belloni2018-03-011-18/+0
| | | | | | sirfsoc_rtc_ioctl() doesn't implement any actual ioctl, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: m48t59: use generic nvmemAlexandre Belloni2018-03-011-32/+24
| | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: m48t59: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+7
| | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1343: use generic nvmemAlexandre Belloni2018-03-011-46/+20
| | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ds1343: remove undocumented and useless sysfs filesAlexandre Belloni2018-03-011-95/+1
| | | | | | | A documented ABI already exists to get information about the alarm. It is the only one that is used. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>