Re: [PATCH v10 5/5] Watchdog: ARM SBSA Generic Watchdog half timeout panic support

From: Timur Tabi
Date: Thu Feb 04 2016 - 11:43:23 EST


Mathieu Poirier wrote:
>+#ifdef CONFIG_ARM_SBSA_WATCHDOG_PANIC
>+ irq = platform_get_irq(pdev, 0);
>+ if (irq < 0) {
>+ dev_err(dev, "unable to get ws0 interrupt.\n");
>+ return irq;
>+ }
>+#endif
>+
Can't the driver revert to single stage mode if platform_get_irq()
fails? That way the value of 'irq' can be tested throughout the
_probe() function and the #ifdefs removed.

I like that idea. The same can be done with the devm_request_irq() call. It should definitely still display a warning if the command-line option is set but no interrupt is available.