Thread (1 message) 1 message, 1 author, 2014-01-21

[PATCH v3 04/15] watchdog: orion: Handle IRQ

From: Ezequiel Garcia <hidden>
Date: 2014-01-21 14:35:59
Also in: linux-devicetree, linux-watchdog

On Tue, Jan 21, 2014 at 06:31:02AM -0800, Guenter Roeck wrote:
On 01/21/2014 05:26 AM, Ezequiel Garcia wrote:
quoted
DT-enabled where an irqchip driver for the brigde interrupt controller is
available can handle the watchdog IRQ properly. Therefore, we request
the interruption and add a dummy handler that merely calls panic().

This is done in order to have an initial 'ack' of the interruption,
which clears the watchdog state.

Furthermore, since some platforms don't have such IRQ, this commit
makes the interruption specification optional.

Signed-off-by: Ezequiel Garcia <redacted>
---
  .../devicetree/bindings/watchdog/marvel.txt        |  2 ++
  drivers/watchdog/orion_wdt.c                       | 22 +++++++++++++++++++++-
  2 files changed, 23 insertions(+), 1 deletion(-)
[ ... ]
quoted
  static int orion_wdt_probe(struct platform_device *pdev)
  {
  	struct resource *res;
-	int ret;
+	int ret, irq;

  	clk = devm_clk_get(&pdev->dev, NULL);
  	if (IS_ERR(clk)) {
@@ -131,6 +138,19 @@ static int orion_wdt_probe(struct platform_device *pdev)
  	if (!wdt_reg)
  		return -ENOMEM;

+	irq = platform_get_irq(pdev, 0);
+	if (irq > 0) {
0 is a valid interrupt number, and platform_get_irq returns an error code on errors.
Should be >= 0.
Yes, indeed. I'll wait to see if there's any other feedback and then send a v4.

Thanks a lot!
-- 
Ezequiel Garc?a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help