diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2025-02-27 14:42:58 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2025-04-08 15:56:19 +0200 |
commit | fb06b6b54b33b145925e18fc2e66498cf98ed9fb (patch) | |
tree | 4fecd8bdaf4ef9c7e7ead0e0f55475887775df31 | |
parent | c090d390e5ed917a7f33a35da9bd8de4b505cc8e (diff) |
rtc: sh: only disable carry interrupts in probe()
With old, custom UIE handling removed, we can now disable the carry
interrupt in probe() and leave it like this. No further handling is
required.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250227134256.9167-13-wsa+renesas@sang-engineering.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | drivers/rtc/rtc-sh.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c index f8227a71084a..469806604f31 100644 --- a/drivers/rtc/rtc-sh.c +++ b/drivers/rtc/rtc-sh.c @@ -213,25 +213,6 @@ static int sh_rtc_proc(struct device *dev, struct seq_file *seq) return 0; } -static inline void sh_rtc_setcie(struct device *dev, unsigned int enable) -{ - struct sh_rtc *rtc = dev_get_drvdata(dev); - unsigned int tmp; - - spin_lock_irq(&rtc->lock); - - tmp = readb(rtc->regbase + RCR1); - - if (!enable) - tmp &= ~RCR1_CIE; - else - tmp |= RCR1_CIE; - - writeb(tmp, rtc->regbase + RCR1); - - spin_unlock_irq(&rtc->lock); -} - static int sh_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) { sh_rtc_setaie(dev, enabled); @@ -434,6 +415,7 @@ static int __init sh_rtc_probe(struct platform_device *pdev) struct resource *res; char clk_name[14]; int clk_id, ret; + unsigned int tmp; rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); if (unlikely(!rtc)) @@ -553,8 +535,9 @@ static int __init sh_rtc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, rtc); /* everything disabled by default */ - sh_rtc_setaie(&pdev->dev, 0); - sh_rtc_setcie(&pdev->dev, 0); + tmp = readb(rtc->regbase + RCR1); + tmp &= ~(RCR1_CIE | RCR1_AIE); + writeb(tmp, rtc->regbase + RCR1); rtc->rtc_dev->ops = &sh_rtc_ops; rtc->rtc_dev->max_user_freq = 256; @@ -585,7 +568,6 @@ static void __exit sh_rtc_remove(struct platform_device *pdev) struct sh_rtc *rtc = platform_get_drvdata(pdev); sh_rtc_setaie(&pdev->dev, 0); - sh_rtc_setcie(&pdev->dev, 0); clk_disable(rtc->clk); } |