Skip to contentSkip to conversation

pinctrl: berlin: fix an error code in berlin_pinctrl_probe()

PATCH In review Dan Carpenter 3 participants 3 messages Jun 11, 2014 – Jul 4, 2014

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

PATCH 1/1 pinctrl: berlin: fix an error code in berlin_pinctrl_probe()

We are returning success here because PTR_ERR(NULL) is zero. We should be returning -ENODEV.

Fixes 3de68d331c24 ('pinctrl: berlin: add the core pinctrl driver for Marvell Berlin SoCs')
drivers/pinctrl/berlin/berlin.c +1 -1
index edf5d2f..86db223 100644
@@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
 
 	regmap = dev_get_regmap(&pdev->dev, NULL);
 	if (!regmap)
-		return PTR_ERR(regmap);
+		return -ENODEV;
 
 	pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
 	if (!pctrl)
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dan Carpenter

We are returning success here because PTR_ERR(NULL) is zero. We should be returning -ENODEV.

Fixes 3de68d331c24 ('pinctrl: berlin: add the core pinctrl driver for Marvell Berlin SoCs')

Dan, thanks for the fix!

Quoted 14 lines
drivers/pinctrl/berlin/berlin.c +1 -1
index edf5d2f..86db223 100644
@@ -320,7 +320,7 @@ int berlin_pinctrl_probe(struct platform_device *pdev,
 
  	regmap = dev_get_regmap(&pdev->dev, NULL);
  	if (!regmap)
-		return PTR_ERR(regmap);
+		return -ENODEV;
 
  	pctrl = devm_kzalloc(dev, sizeof(*pctrl), GFP_KERNEL);
  	if (!pctrl)