Skip to contentSkip to conversation

watchdog: remove error message when unable to allocate watchdog device

PATCH In review Colin King 3 participants 3 messages Apr 26, 2016 – May 14, 2016

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 watchdog: remove error message when unable to allocate watchdog device

From: Colin Ian King <[email protected]>

The dev_err message is superfluous because the failure is already printed by dev_kzalloc, so remove it.

---
 drivers/watchdog/jz4740_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/jz4740_wdt.c +1 -3
index 6a7d5c3..c8d51dd 100644
@@ -160,10 +160,8 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 
 	drvdata = devm_kzalloc(&pdev->dev, sizeof(struct jz4740_wdt_drvdata),
 			       GFP_KERNEL);
-	if (!drvdata) {
-		dev_err(&pdev->dev, "Unable to alloacate watchdog device\n");
+	if (!drvdata)
 		return -ENOMEM;
-	}
 
 	if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
 		heartbeat = DEFAULT_HEARTBEAT;
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Colin King

From: Colin Ian King <[email protected]>

The dev_err message is superfluous because the failure is already printed by dev_kzalloc, so remove it.

Nitpick: devm_kzalloc

Quoted 1 line

Thanks,
Guenter

Quoted 21 lines
---
  drivers/watchdog/jz4740_wdt.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/jz4740_wdt.c +1 -3
index 6a7d5c3..c8d51dd 100644
@@ -160,10 +160,8 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 
  	drvdata = devm_kzalloc(&pdev->dev, sizeof(struct jz4740_wdt_drvdata),
  			       GFP_KERNEL);
-	if (!drvdata) {
-		dev_err(&pdev->dev, "Unable to alloacate watchdog device\n");
+	if (!drvdata)
  		return -ENOMEM;
-	}
 
  	if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
  		heartbeat = DEFAULT_HEARTBEAT;
#2 lore raw
In reply to Colin King

Hi Colin,

Quoted 29 lines

From: Colin Ian King <[email protected]>

The dev_err message is superfluous because the failure is already printed by dev_kzalloc, so remove it.

---
 drivers/watchdog/jz4740_wdt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/watchdog/jz4740_wdt.c +1 -3
index 6a7d5c3..c8d51dd 100644
@@ -160,10 +160,8 @@ static int jz4740_wdt_probe(struct platform_device *pdev)
 
 	drvdata = devm_kzalloc(&pdev->dev, sizeof(struct jz4740_wdt_drvdata),
 			       GFP_KERNEL);
-	if (!drvdata) {
-		dev_err(&pdev->dev, "Unable to alloacate watchdog device\n");
+	if (!drvdata)
 		return -ENOMEM;
-	}
 
 	if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT)
 		heartbeat = DEFAULT_HEARTBEAT;
Signature · 1 line
2.7.4

This patch was added to linux-watchdog-next.

Kind Regards,
Wim.