Skip to contentSkip to conversation

watchdog: ts72xx_wdt: Propagate return value from timeout_to_regval

PATCH In review Guenter Roeck 2 participants 2 messages Oct 14, 2013 – Oct 29, 2013 Watchdog device drivers

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 watchdog: ts72xx_wdt: Propagate return value from timeout_to_regval

timeout_to_regval() returns a valid error code. Might as well use it.

---
 drivers/watchdog/ts72xx_wdt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/ts72xx_wdt.c +1 -1
index 42913f1..a4f3ce5 100644
@@ -192,7 +192,7 @@ static int ts72xx_wdt_open(struct inode *inode, struct file *file)
 		dev_err(&wdt->pdev->dev,
 			"failed to convert timeout (%d) to register value\n",
 			timeout);
-		return -EINVAL;
+		return regval;
 	}
 
 	if (mutex_lock_interruptible(&wdt->lock))
Signature · 1 line
1.7.9.7
#1 lore raw

Hi Guenter,

Quoted 12 lines

timeout_to_regval() returns a valid error code. Might as well use it.

---
 drivers/watchdog/ts72xx_wdt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/ts72xx_wdt.c +0 -0
index 42913f1..a4f3ce5 100644

drivers/watchdog/ts72xx_wdt.c static int ts72xx_wdt_open(struct inode *inode, struct file *file) · line 198

Quoted 8 lines
drivers/watchdog/ts72xx_wdt.c +1 -1
@@ -192,7 +192,7 @@ static int ts72xx_wdt_open(struct inode *inode, struct file *file)
 		dev_err(&wdt->pdev->dev,
 			"failed to convert timeout (%d) to register value\n",
 			timeout);
-		return -EINVAL;
+		return regval;
 	}
 
 	if (mutex_lock_interruptible(&wdt->lock))

This patch has been added to linux-watchdog-next.

Kind regards,
Wim.