summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-sunxi.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1Thomas Gleixner2019-05-211-14/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option [no]_[pad]_[ctrl] any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 51 franklin street fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 176 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154040.652910950@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* rtc: sunxi: fix possible race conditionAlexandre Belloni2018-06-041-14/+9Star
| | | | | | | | | | | | | The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc before requesting the IRQ. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 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: sunxi: use of_device_get_match_dataLABBE Corentin2016-01-111-4/+2Star
| | | | | | | | The usage of of_device_get_match_data reduce the code size a bit. Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: sunxi: constify the data_year_param structureLABBE Corentin2016-01-111-3/+3
| | | | | | | | | The data_year_param struct is never modified, so lets constify it. This permit to remove cast since of_device_id is const also. Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: sunxi: fix signedness issuesLABBE Corentin2016-01-111-4/+4
| | | | | | | | | | | | | | | | The variable year must be set as unsigned since it is used with sunxi_rtc_data_year{.min|.max} and as parameter of is_leap_year() which wait for unsigned int. Only tm_year is not unsigned, but it is long. This patch fix also the format of printing of min/max. (must use %u since they are unsigned) The parameter to of sunxi_rtc_setaie() must be set to uint since callers give always uint data. Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: sunxi: Replace deprecated rtc_tm_to_time()Xunlei Pang2015-06-251-17/+15Star
| | | | | | | | | | | | | | | sunxi_rtc_setalarm() uses deprecated rtc_tm_to_time(), which will overflow in year 2106 on 32-bit machines. This patch solves this by: - Replacing rtc_tm_to_time() with rtc_tm_sub() Also remove the unnecessary initial zeroing of some local variables in sunxi_rtc_setalarm(). Cc: Carlo Caione <carlo.caione@gmail.com> Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0Star
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* rtc: sunxi: change compatiblesMaxime Ripard2014-04-041-1/+1
| | | | | | | | | | | The Allwinner A10 compatibles were following a slightly different compatible patterns than the rest of the SoCs for historical reasons. Change the compatibles to match the other pattern in the RTC driver for consistency. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* ARM: sun4i/sun7i: RTC driverCarlo Caione2013-12-201-0/+523
This patch introduces the driver for the RTC in the Allwinner A10 and A20 SoCs. Signed-off-by: Carlo Caione <carlo.caione@gmail.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>