Commit eae258ed authored by Doug Berger's avatar Doug Berger Committed by Alexandre Belloni

rtc: brcmstb-waketimer: rename irq to wake_irq

In preparation for adding a second interrupt to service RTC
interrupts, the existing interrupt is renamed from the generic
'irq' to 'wake_irq' to more clearly convey its role.

It is also converted to an unsigned int.

Finally, the driver message that outputs the IRQ number when
registered is removed since devm_rtc_register_device() already
provides a report of registration and the interrupts can be
found in /proc/interrupts.
Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20230120190147.718976-5-opendmb@gmail.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 516ae02c
...@@ -27,7 +27,7 @@ struct brcmstb_waketmr { ...@@ -27,7 +27,7 @@ struct brcmstb_waketmr {
struct rtc_device *rtc; struct rtc_device *rtc;
struct device *dev; struct device *dev;
void __iomem *base; void __iomem *base;
int irq; unsigned int wake_irq;
struct notifier_block reboot_notifier; struct notifier_block reboot_notifier;
struct clk *clk; struct clk *clk;
u32 rate; u32 rate;
...@@ -117,7 +117,7 @@ static int brcmstb_waketmr_prepare_suspend(struct brcmstb_waketmr *timer) ...@@ -117,7 +117,7 @@ static int brcmstb_waketmr_prepare_suspend(struct brcmstb_waketmr *timer)
int ret = 0; int ret = 0;
if (device_may_wakeup(dev)) { if (device_may_wakeup(dev)) {
ret = enable_irq_wake(timer->irq); ret = enable_irq_wake(timer->wake_irq);
if (ret) { if (ret) {
dev_err(dev, "failed to enable wake-up interrupt\n"); dev_err(dev, "failed to enable wake-up interrupt\n");
return ret; return ret;
...@@ -246,9 +246,10 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev) ...@@ -246,9 +246,10 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev)
*/ */
device_init_wakeup(dev, true); device_init_wakeup(dev, true);
timer->irq = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (timer->irq < 0) if (ret < 0)
return -ENODEV; return -ENODEV;
timer->wake_irq = (unsigned int)ret;
timer->clk = devm_clk_get(dev, NULL); timer->clk = devm_clk_get(dev, NULL);
if (!IS_ERR(timer->clk)) { if (!IS_ERR(timer->clk)) {
...@@ -263,7 +264,7 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev) ...@@ -263,7 +264,7 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev)
timer->clk = NULL; timer->clk = NULL;
} }
ret = devm_request_irq(dev, timer->irq, brcmstb_waketmr_irq, 0, ret = devm_request_irq(dev, timer->wake_irq, brcmstb_waketmr_irq, 0,
"brcmstb-waketimer", timer); "brcmstb-waketimer", timer);
if (ret < 0) if (ret < 0)
goto err_clk; goto err_clk;
...@@ -278,8 +279,6 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev) ...@@ -278,8 +279,6 @@ static int brcmstb_waketmr_probe(struct platform_device *pdev)
if (ret) if (ret)
goto err_notifier; goto err_notifier;
dev_info(dev, "registered, with irq %d\n", timer->irq);
return 0; return 0;
err_notifier: err_notifier:
...@@ -317,7 +316,7 @@ static int brcmstb_waketmr_resume(struct device *dev) ...@@ -317,7 +316,7 @@ static int brcmstb_waketmr_resume(struct device *dev)
if (!device_may_wakeup(dev)) if (!device_may_wakeup(dev))
return 0; return 0;
ret = disable_irq_wake(timer->irq); ret = disable_irq_wake(timer->wake_irq);
brcmstb_waketmr_clear_alarm(timer); brcmstb_waketmr_clear_alarm(timer);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment