Skip to contentSkip to conversation

watchdog: at91rm9200: Correct check for syscon_node_to_regmap() errors

PATCH In review Bjorn Andersson 2 participants 2 messages Aug 17, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: at91rm9200: Correct check for syscon_node_to_regmap() errors

syscon_node_to_regmap() returns a regmap or an ERR_PTR().

---
 drivers/watchdog/at91rm9200_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/at91rm9200_wdt.c +1 -1
index 9ba1153465ae..e12a797cb820 100644
@@ -244,7 +244,7 @@ static int at91wdt_probe(struct platform_device *pdev)
 	}
 
 	regmap_st = syscon_node_to_regmap(parent->of_node);
-	if (!regmap_st)
+	if (IS_ERR(regmap_st))
 		return -ENODEV;
 
 	res = misc_register(&at91wdt_miscdev);
Signature · 1 line
1.8.2.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Bjorn Andersson

syscon_node_to_regmap() returns a regmap or an ERR_PTR().

Quoted 18 lines
---
  drivers/watchdog/at91rm9200_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/at91rm9200_wdt.c +1 -1
index 9ba1153465ae..e12a797cb820 100644
@@ -244,7 +244,7 @@ static int at91wdt_probe(struct platform_device *pdev)
  	}
 
  	regmap_st = syscon_node_to_regmap(parent->of_node);
-	if (!regmap_st)
+	if (IS_ERR(regmap_st))
  		return -ENODEV;
 
  	res = misc_register(&at91wdt_miscdev);