Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] watchdog: orion: fix platform_get_irq() complaints
@ 2019-11-29 14:51 Russell King
  2019-11-29 14:56 ` Russell King - ARM Linux admin
  2019-11-29 15:51 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Russell King @ 2019-11-29 14:51 UTC (permalink / raw)
  To: Guenter Roeck, Wim Van Sebroeck; +Cc: linux-watchdog

Fix:

orion_wdt f1020300.watchdog: IRQ index 1 not found

which is caused by platform_get_irq() now complaining when optional
IRQs are not found.  Neither interrupt for orion is required, so
make them both optional.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/watchdog/orion_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 1cccf8eb1c5d..8e6dfe76f9c9 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -602,7 +602,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
 		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
 
 	/* Request the IRQ only after the watchdog is disabled */
-	irq = platform_get_irq(pdev, 0);
+	irq = platform_get_irq_optional(pdev, 0);
 	if (irq > 0) {
 		/*
 		 * Not all supported platforms specify an interrupt for the
@@ -617,7 +617,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
 	}
 
 	/* Optional 2nd interrupt for pretimeout */
-	irq = platform_get_irq(pdev, 1);
+	irq = platform_get_irq_optional(pdev, 1);
 	if (irq > 0) {
 		orion_wdt_info.options |= WDIOF_PRETIMEOUT;
 		ret = devm_request_irq(&pdev->dev, irq, orion_wdt_pre_irq,
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] watchdog: orion: fix platform_get_irq() complaints
  2019-11-29 14:51 [PATCH] watchdog: orion: fix platform_get_irq() complaints Russell King
@ 2019-11-29 14:56 ` Russell King - ARM Linux admin
  2019-11-29 15:51 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux admin @ 2019-11-29 14:56 UTC (permalink / raw)
  To: Guenter Roeck, Wim Van Sebroeck; +Cc: linux-watchdog

On Fri, Nov 29, 2019 at 02:51:35PM +0000, Russell King wrote:
> Fix:
> 
> orion_wdt f1020300.watchdog: IRQ index 1 not found
> 
> which is caused by platform_get_irq() now complaining when optional
> IRQs are not found.  Neither interrupt for orion is required, so
> make them both optional.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Note that it's a tad difficult to add an accurate Fixes: tag here
because the commit introducing the error message (7723f4c5ecdb) is
earlier than the commit introducing the functions to work around it.

> ---
>  drivers/watchdog/orion_wdt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 1cccf8eb1c5d..8e6dfe76f9c9 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -602,7 +602,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
>  		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
>  
>  	/* Request the IRQ only after the watchdog is disabled */
> -	irq = platform_get_irq(pdev, 0);
> +	irq = platform_get_irq_optional(pdev, 0);
>  	if (irq > 0) {
>  		/*
>  		 * Not all supported platforms specify an interrupt for the
> @@ -617,7 +617,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
>  	}
>  
>  	/* Optional 2nd interrupt for pretimeout */
> -	irq = platform_get_irq(pdev, 1);
> +	irq = platform_get_irq_optional(pdev, 1);
>  	if (irq > 0) {
>  		orion_wdt_info.options |= WDIOF_PRETIMEOUT;
>  		ret = devm_request_irq(&pdev->dev, irq, orion_wdt_pre_irq,
> -- 
> 2.20.1
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] watchdog: orion: fix platform_get_irq() complaints
  2019-11-29 14:51 [PATCH] watchdog: orion: fix platform_get_irq() complaints Russell King
  2019-11-29 14:56 ` Russell King - ARM Linux admin
@ 2019-11-29 15:51 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-11-29 15:51 UTC (permalink / raw)
  To: Russell King, Wim Van Sebroeck; +Cc: linux-watchdog

On 11/29/19 6:51 AM, Russell King wrote:
> Fix:
> 
> orion_wdt f1020300.watchdog: IRQ index 1 not found
> 
> which is caused by platform_get_irq() now complaining when optional
> IRQs are not found.  Neither interrupt for orion is required, so
> make them both optional.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   drivers/watchdog/orion_wdt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
> index 1cccf8eb1c5d..8e6dfe76f9c9 100644
> --- a/drivers/watchdog/orion_wdt.c
> +++ b/drivers/watchdog/orion_wdt.c
> @@ -602,7 +602,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
>   		set_bit(WDOG_HW_RUNNING, &dev->wdt.status);
>   
>   	/* Request the IRQ only after the watchdog is disabled */
> -	irq = platform_get_irq(pdev, 0);
> +	irq = platform_get_irq_optional(pdev, 0);
>   	if (irq > 0) {
>   		/*
>   		 * Not all supported platforms specify an interrupt for the
> @@ -617,7 +617,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
>   	}
>   
>   	/* Optional 2nd interrupt for pretimeout */
> -	irq = platform_get_irq(pdev, 1);
> +	irq = platform_get_irq_optional(pdev, 1);
>   	if (irq > 0) {
>   		orion_wdt_info.options |= WDIOF_PRETIMEOUT;
>   		ret = devm_request_irq(&pdev->dev, irq, orion_wdt_pre_irq,
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-29 14:51 [PATCH] watchdog: orion: fix platform_get_irq() complaints Russell King
2019-11-29 14:56 ` Russell King - ARM Linux admin
2019-11-29 15:51 ` Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git