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>
"port %u\n", dev_addr, port_idx);
result = wusb_set_dev_addr(wusbhc, wusb_dev, dev_addr);
- if (result)
- return NULL;
+ if (result < 0)
+ return NULL;
}
wusb_dev->entry_ts = jiffies;
list_add_tail(&wusb_dev->cack_node, &wusbhc->cack_list);
wusb_dev->addr = addr;
result = wusbhc->dev_info_set(wusbhc, wusb_dev);
- if (result)
+ if (result < 0)
dev_err(wusbhc->dev, "device %d: failed to set device "
"address\n", wusb_dev->port_idx);
else