[PATCH RFC 2/3] usb: twl6030: fix the error check for omap_usb2_set_comparator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function omap_usb2_set_comparator may return -ENODEV.
Use a signed variable to store and check so that the value
is not wrongly interpreted as a large positive number.
While at it lets use the err variable to do the same.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@xxxxxx>
---
untested

 drivers/usb/otg/twl6030-usb.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c
index fcadef7..11c22f3 100644
--- a/drivers/usb/otg/twl6030-usb.c
+++ b/drivers/usb/otg/twl6030-usb.c
@@ -312,7 +312,6 @@ static int twl6030_set_vbus(struct phy_companion *comparator, bool enabled)
 
 static int __devinit twl6030_usb_probe(struct platform_device *pdev)
 {
-	u32 ret;
 	struct twl6030_usb	*twl;
 	int			status, err;
 	struct device_node	*np = pdev->dev.of_node;
@@ -331,8 +330,8 @@ static int __devinit twl6030_usb_probe(struct platform_device *pdev)
 	twl->comparator.set_vbus	= twl6030_set_vbus;
 	twl->comparator.start_srp	= twl6030_start_srp;
 
-	ret = omap_usb2_set_comparator(&twl->comparator);
-	if (ret == -ENODEV) {
+	err = omap_usb2_set_comparator(&twl->comparator);
+	if (err == -ENODEV) {
 		dev_info(&pdev->dev, "phy not ready, deferring probe");
 		return -EPROBE_DEFER;
 	}
-- 
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux