Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

André Draszik and committed by
Lee Jones
c70aee3d 153ae5c5

+8 -13
+8 -13
drivers/rtc/rtc-s5m.c
··· 15 15 #include <linux/rtc.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/mfd/samsung/core.h> 18 - #include <linux/mfd/samsung/irq.h> 19 18 #include <linux/mfd/samsung/rtc.h> 20 19 #include <linux/mfd/samsung/s2mps14.h> 21 20 ··· 682 683 case S2MPS15X: 683 684 regmap_cfg = &s2mps14_rtc_regmap_config; 684 685 info->regs = &s2mps15_rtc_regs; 685 - alarm_irq = S2MPS14_IRQ_RTCA0; 686 686 break; 687 687 case S2MPS14X: 688 688 regmap_cfg = &s2mps14_rtc_regmap_config; 689 689 info->regs = &s2mps14_rtc_regs; 690 - alarm_irq = S2MPS14_IRQ_RTCA0; 691 690 break; 692 691 case S2MPS13X: 693 692 regmap_cfg = &s2mps14_rtc_regmap_config; 694 693 info->regs = &s2mps13_rtc_regs; 695 - alarm_irq = S2MPS14_IRQ_RTCA0; 696 694 break; 697 695 case S5M8767X: 698 696 regmap_cfg = &s5m_rtc_regmap_config; 699 697 info->regs = &s5m_rtc_regs; 700 - alarm_irq = S5M8767_IRQ_RTCA1; 701 698 break; 702 699 default: 703 700 return dev_err_probe(&pdev->dev, -ENODEV, ··· 714 719 "Failed to allocate regmap\n"); 715 720 } else if (device_type == S2MPG10) { 716 721 info->regs = &s2mpg10_rtc_regs; 717 - alarm_irq = S2MPG10_IRQ_RTCA0; 718 722 } else { 719 723 return dev_err_probe(&pdev->dev, -ENODEV, 720 724 "Unsupported device type %d\n", ··· 724 730 info->s5m87xx = s5m87xx; 725 731 info->device_type = device_type; 726 732 727 - if (s5m87xx->irq_data) { 728 - info->irq = regmap_irq_get_virq(s5m87xx->irq_data, alarm_irq); 729 - if (info->irq <= 0) 730 - return dev_err_probe(&pdev->dev, -EINVAL, 731 - "Failed to get virtual IRQ %d\n", 732 - alarm_irq); 733 - } 733 + alarm_irq = platform_get_irq_byname_optional(pdev, "alarm"); 734 + if (alarm_irq > 0) 735 + info->irq = alarm_irq; 736 + else if (alarm_irq == -ENXIO) 737 + info->irq = 0; 738 + else 739 + return dev_err_probe(&pdev->dev, alarm_irq ? : -EINVAL, 740 + "IRQ 'alarm' not found\n"); 734 741 735 742 platform_set_drvdata(pdev, info); 736 743