[PATCHv2 2/3] watchdog: sama5d4: use platform_get_irq_optional()
Guenter Roeck
linux at roeck-us.net
Mon Jun 8 15:44:36 PDT 2026
On 6/8/26 13:09, Rosen Penev wrote:
> irq_of_parse_and_map() requires irq_dispose_mapping() on failure. Don't
> bother with it as platform_get_irq_optional() doesn't need it.
>
> Also handle EPROBE_DEFER.
>
That is misleading. irq_of_parse_and_map() did not return errors,
so this is not an "also" but made necessary by the use of
platform_get_irq_optional(). That means that replacing the
call with platform_get_irq_optional() is not a 1:1 replacement,
making its use risky without extensive testing.
A much safer solution is to add a call to devm_add_action_or_reset()
after successful irq_of_parse_and_map() and to call irq_dispose_mapping()
from its callback function.
Thanks,
Guenter
More information about the linux-arm-kernel
mailing list