Skip to contentSkip to conversation

pinctrl: tegra-xusb: testing wrong variable in probe()

PATCH In review Dan Carpenter 3 participants 3 messages Jul 31, 2014 – Aug 11, 2014

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

PATCH 2/2 pinctrl: tegra-xusb: testing wrong variable in probe()

There is a cut and paste bug so we test the wrong variable. "err" is never less than zero at this point.

drivers/pinctrl/pinctrl-tegra-xusb.c +2 -1
index 419a047..e641b42 100644
@@ -930,7 +930,8 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
 
 	padctl->provider = devm_of_phy_provider_register(&pdev->dev,
 							 tegra_xusb_padctl_xlate);
-	if (err < 0) {
+	if (IS_ERR(padctl->provider)) {
+		err = PTR_ERR(padctl->provider);
 		dev_err(&pdev->dev, "failed to register PHYs: %d\n", err);
 		goto unregister;
 	}
Acked-by on v1 2/2
#1 lore raw
Quoted 10 lines · Dan Carpenter

There is a cut and paste bug so we test the wrong variable. "err" is never less than zero at this point.

drivers/pinctrl/pinctrl-tegra-xusb.c +0 -0
index 419a047..e641b42 100644

drivers/pinctrl/pinctrl-tegra-xusb.c static int tegra_xusb_padctl_probe(struct platform_device *pdev) · line 937

Quoted 9 lines
drivers/pinctrl/pinctrl-tegra-xusb.c +2 -1
@@ -930,7 +930,8 @@ static int tegra_xusb_padctl_probe(struct platform_device *pdev)
 
 	padctl->provider = devm_of_phy_provider_register(&pdev->dev,
 							 tegra_xusb_padctl_xlate);
-	if (err < 0) {
+	if (IS_ERR(padctl->provider)) {
+		err = PTR_ERR(padctl->provider);
 		dev_err(&pdev->dev, "failed to register PHYs: %d\n", err);
 		goto unregister;
 	}

And another good catch. Thanks Dan.