aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@indt.org.br>2008-09-17 11:34:31 -0400
committerDavid Vrabel <dv02@dv02pc01.europe.root.pri>2008-09-17 11:54:32 -0400
commitf51c23baedf191734364d3aae034d8c9c4cd8cf8 (patch)
tree1a6f39a68f02dc4738290ae7a5a08717e9bbc36f /drivers/usb
parentd09318b8ab2eabb65b6fa0dc04dab1822846eabb (diff)
wusb: fix error path for wusb_set_dev_addr()
Error path for wusb_set_dev_addr() was handled incorrectly. Fix it by considering error only when return value is negative. Signed-off-by: Anderson Lizardo <anderson.lizardo@indt.org.br> Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/wusbcore/devconnect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/wusbcore/devconnect.c b/drivers/usb/wusbcore/devconnect.c
index f05f9b4d7751..30d7020e1c50 100644
--- a/drivers/usb/wusbcore/devconnect.c
+++ b/drivers/usb/wusbcore/devconnect.c
@@ -239,8 +239,8 @@ static struct wusb_dev *wusbhc_cack_add(struct wusbhc *wusbhc,
239 "port %u\n", dev_addr, port_idx); 239 "port %u\n", dev_addr, port_idx);
240 240
241 result = wusb_set_dev_addr(wusbhc, wusb_dev, dev_addr); 241 result = wusb_set_dev_addr(wusbhc, wusb_dev, dev_addr);
242 if (result) 242 if (result < 0)
243 return NULL; 243 return NULL;
244 } 244 }
245 wusb_dev->entry_ts = jiffies; 245 wusb_dev->entry_ts = jiffies;
246 list_add_tail(&wusb_dev->cack_node, &wusbhc->cack_list); 246 list_add_tail(&wusb_dev->cack_node, &wusbhc->cack_list);
@@ -1301,7 +1301,7 @@ int wusb_set_dev_addr(struct wusbhc *wusbhc, struct wusb_dev *wusb_dev, u8 addr)
1301 1301
1302 wusb_dev->addr = addr; 1302 wusb_dev->addr = addr;
1303 result = wusbhc->dev_info_set(wusbhc, wusb_dev); 1303 result = wusbhc->dev_info_set(wusbhc, wusb_dev);
1304 if (result) 1304 if (result < 0)
1305 dev_err(wusbhc->dev, "device %d: failed to set device " 1305 dev_err(wusbhc->dev, "device %d: failed to set device "
1306 "address\n", wusb_dev->port_idx); 1306 "address\n", wusb_dev->port_idx);
1307 else 1307 else