Skip to content

Commit fb06b6b

Browse files
Wolfram Sangalexandrebelloni
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent c090d39 commit fb06b6b

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

drivers/rtc/rtc-sh.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -213,25 +213,6 @@ static int sh_rtc_proc(struct device *dev, struct seq_file *seq)
213213
return 0;
214214
}
215215

216-
static inline void sh_rtc_setcie(struct device *dev, unsigned int enable)
217-
{
218-
struct sh_rtc *rtc = dev_get_drvdata(dev);
219-
unsigned int tmp;
220-
221-
spin_lock_irq(&rtc->lock);
222-
223-
tmp = readb(rtc->regbase + RCR1);
224-
225-
if (!enable)
226-
tmp &= ~RCR1_CIE;
227-
else
228-
tmp |= RCR1_CIE;
229-
230-
writeb(tmp, rtc->regbase + RCR1);
231-
232-
spin_unlock_irq(&rtc->lock);
233-
}
234-
235216
static int sh_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
236217
{
237218
sh_rtc_setaie(dev, enabled);
@@ -434,6 +415,7 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
434415
struct resource *res;
435416
char clk_name[14];
436417
int clk_id, ret;
418+
unsigned int tmp;
437419

438420
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
439421
if (unlikely(!rtc))
@@ -553,8 +535,9 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
553535
platform_set_drvdata(pdev, rtc);
554536

555537
/* everything disabled by default */
556-
sh_rtc_setaie(&pdev->dev, 0);
557-
sh_rtc_setcie(&pdev->dev, 0);
538+
tmp = readb(rtc->regbase + RCR1);
539+
tmp &= ~(RCR1_CIE | RCR1_AIE);
540+
writeb(tmp, rtc->regbase + RCR1);
558541

559542
rtc->rtc_dev->ops = &sh_rtc_ops;
560543
rtc->rtc_dev->max_user_freq = 256;
@@ -585,7 +568,6 @@ static void __exit sh_rtc_remove(struct platform_device *pdev)
585568
struct sh_rtc *rtc = platform_get_drvdata(pdev);
586569

587570
sh_rtc_setaie(&pdev->dev, 0);
588-
sh_rtc_setcie(&pdev->dev, 0);
589571

590572
clk_disable(rtc->clk);
591573
}

0 commit comments

Comments
 (0)