mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-03-03 18:28:01 +01:00
rtc: s5m: query platform device IRQ resource for alarm IRQ
The core driver now exposes the alarm IRQ as a resource, so we can drop the lookup from here to simplify the code and make adding support for additional variants easier in this driver. Signed-off-by: André Draszik <andre.draszik@linaro.org> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://patch.msgid.link/20260113-s5m-alarm-v3-2-855a19db1277@linaro.org Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mfd/samsung/core.h>
|
||||
#include <linux/mfd/samsung/irq.h>
|
||||
#include <linux/mfd/samsung/rtc.h>
|
||||
#include <linux/mfd/samsung/s2mps14.h>
|
||||
|
||||
@@ -683,22 +682,18 @@ static int s5m_rtc_probe(struct platform_device *pdev)
|
||||
case S2MPS15X:
|
||||
regmap_cfg = &s2mps14_rtc_regmap_config;
|
||||
info->regs = &s2mps15_rtc_regs;
|
||||
alarm_irq = S2MPS14_IRQ_RTCA0;
|
||||
break;
|
||||
case S2MPS14X:
|
||||
regmap_cfg = &s2mps14_rtc_regmap_config;
|
||||
info->regs = &s2mps14_rtc_regs;
|
||||
alarm_irq = S2MPS14_IRQ_RTCA0;
|
||||
break;
|
||||
case S2MPS13X:
|
||||
regmap_cfg = &s2mps14_rtc_regmap_config;
|
||||
info->regs = &s2mps13_rtc_regs;
|
||||
alarm_irq = S2MPS14_IRQ_RTCA0;
|
||||
break;
|
||||
case S5M8767X:
|
||||
regmap_cfg = &s5m_rtc_regmap_config;
|
||||
info->regs = &s5m_rtc_regs;
|
||||
alarm_irq = S5M8767_IRQ_RTCA1;
|
||||
break;
|
||||
default:
|
||||
return dev_err_probe(&pdev->dev, -ENODEV,
|
||||
@@ -719,7 +714,6 @@ static int s5m_rtc_probe(struct platform_device *pdev)
|
||||
"Failed to allocate regmap\n");
|
||||
} else if (device_type == S2MPG10) {
|
||||
info->regs = &s2mpg10_rtc_regs;
|
||||
alarm_irq = S2MPG10_IRQ_RTCA0;
|
||||
} else {
|
||||
return dev_err_probe(&pdev->dev, -ENODEV,
|
||||
"Unsupported device type %d\n",
|
||||
@@ -730,13 +724,14 @@ static int s5m_rtc_probe(struct platform_device *pdev)
|
||||
info->s5m87xx = s5m87xx;
|
||||
info->device_type = device_type;
|
||||
|
||||
if (s5m87xx->irq_data) {
|
||||
info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq);
|
||||
if (info->irq <= 0)
|
||||
return dev_err_probe(&pdev->dev, -EINVAL,
|
||||
"Failed to get virtual IRQ %d\n",
|
||||
alarm_irq);
|
||||
}
|
||||
alarm_irq = platform_get_irq_byname_optional(pdev, "alarm");
|
||||
if (alarm_irq > 0)
|
||||
info->irq = alarm_irq;
|
||||
else if (alarm_irq == -ENXIO)
|
||||
info->irq = 0;
|
||||
else
|
||||
return dev_err_probe(&pdev->dev, alarm_irq ? : -EINVAL,
|
||||
"IRQ 'alarm' not found\n");
|
||||
|
||||
platform_set_drvdata(pdev, info);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user