History log of /linux-master/drivers/rtc/rtc-mt2712.c
Revision Date Author Comments
# fdcfd854 09-Nov-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

rtc: rework rtc_register_device() resource management

rtc_register_device() is a managed interface but it doesn't use devres
by itself - instead it marks an rtc_device as "registered" and the devres
callback for devm_rtc_allocate_device() takes care of resource release.

This doesn't correspond with the design behind devres where managed
structures should not be aware of being managed. The correct solution
here is to register a separate devres callback for unregistering the
device.

While at it: rename rtc_register_device() to devm_rtc_register_device()
and add it to the list of managed interfaces in devres.rst. This way we
can avoid any potential confusion of driver developers who may expect
there to exist a corresponding unregister function.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201109163409.24301-8-brgl@bgdev.pl


# 06030d50 15-Apr-2020 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: mt2712: switch to devm_platform_ioremap_resource

Using devm_platform_ioremap_resource instead of open coding it reduces the
size of the binary.

text data bss dec hex filename
3728 216 0 3944 f68 drivers/rtc/rtc-mt2712.o
3744 216 0 3960 f78 drivers/rtc/rtc-mt2712.o.old

Link: https://lore.kernel.org/r/20200415200021.157118-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 3642b17e 15-Apr-2020 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: mt2712: remove unnecessary error string

Remove the unnecessary error string as the core will already display error
messages when registration fails (i.e. never).

Link: https://lore.kernel.org/r/20200415200021.157118-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 944ed452 05-Apr-2020 Markus Elfring <elfring@users.sourceforge.net>

rtc: remove unnecessary error message after platform_get_irq

The function “platform_get_irq” can log an error already.
Thus omit redundant messages for the exception handling in the
calling functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://lore.kernel.org/r/04116352-b464-041c-1939-96440133aa6f@web.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 30a79065 17-Mar-2020 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: mt2712: fix build without PM_SLEEP

Fix this build error when PM_SLEEP is not selected:

drivers/rtc/rtc-mt2712.c:412:10: error: ‘mt2712_pm_ops’ undeclared here (not in a function); did you mean ‘mt2712_rtc_ops’?
412 | .pm = &mt2712_pm_ops,
| ^~~~~~~~~~~~~

Link: https://lore.kernel.org/r/20200317143421.9551-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 64823360 25-Feb-2020 Ran Bi <ran.bi@mediatek.com>

rtc: add support for the MediaTek MT2712 RTC

This add support for the MediaTek MT2712 RTC. It was SoC based RTC, but
had different architecture compared with MT7622 RTC.

Signed-off-by: Ran Bi <ran.bi@mediatek.com>
Link: https://lore.kernel.org/r/20200226051303.22560-3-ran.bi@mediatek.com
Link: https://lore.kernel.org/r/20200316104701.209293-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>