[PATCH 3/8] rtc: sa1100: add OF support

Arnd Bergmann arnd at arndb.de
Thu Mar 1 04:51:12 EST 2012


On Thursday 01 March 2012, Haojian Zhuang wrote:
> +#ifdef CONFIG_OF
> +static int sa1100_rtc_probe_dt(struct platform_device *pdev,
> +                              struct sa1100_rtc *info)
> +{
> +       info->irq_alarm = platform_get_irq(pdev, 0);
> +       info->irq_1hz = platform_get_irq(pdev, 1);
> +       if (info->irq_1hz < 0 || info->irq_alarm < 0)
> +               return -ENODEV;
> +       return 0;
> +}
> +#else
> +static int sa1100_rtc_probe_dt(struct platform_device *pdev,
> +                              struct sa1100_rtc *info)
> +{
> +       return 1;
> +}
> +#endif
> +
> +static int sa1100_rtc_probe_irq(struct platform_device *pdev,
> +                               struct sa1100_rtc *info)
> +{
> +       info->irq_1hz = platform_get_irq_byname(pdev, "rtc 1Hz");
> +       info->irq_alarm = platform_get_irq_byname(pdev, "rtc alarm");
> +       if (info->irq_1hz < 0 || info->irq_alarm < 0)
> +               return -ENODEV;
> +       return 0;
> +}

This should not be necessary. I thought we had already added support
for named irq resources coming from the device tree. If not, why not
just make the other ones anonymous as well and just use platform_get_irq()?

	Arnd



More information about the linux-arm-kernel mailing list