mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 21:02:19 +00:00
staging: most: usb: change return value of function drci_rd_reg
This patch makes function drci_rd_reg return 0 in case of success and a negative number else. As no caller is evaluating the number of bytes transferred by function usb_control_msg this information is being omitted. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/1590570387-27069-4-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a0dbe1b24c
commit
ffd069ec04
@ -153,7 +153,9 @@ static inline int drci_rd_reg(struct usb_device *dev, u16 reg, u16 *buf)
|
|||||||
*buf = le16_to_cpu(*dma_buf);
|
*buf = le16_to_cpu(*dma_buf);
|
||||||
kfree(dma_buf);
|
kfree(dma_buf);
|
||||||
|
|
||||||
|
if (retval < 0)
|
||||||
return retval;
|
return retval;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -686,22 +688,22 @@ static void wq_netinfo(struct work_struct *wq_obj)
|
|||||||
u16 hi, mi, lo, link;
|
u16 hi, mi, lo, link;
|
||||||
u8 hw_addr[6];
|
u8 hw_addr[6];
|
||||||
|
|
||||||
if (drci_rd_reg(usb_device, DRCI_REG_HW_ADDR_HI, &hi) < 0) {
|
if (drci_rd_reg(usb_device, DRCI_REG_HW_ADDR_HI, &hi)) {
|
||||||
dev_err(dev, "Vendor request 'hw_addr_hi' failed\n");
|
dev_err(dev, "Vendor request 'hw_addr_hi' failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drci_rd_reg(usb_device, DRCI_REG_HW_ADDR_MI, &mi) < 0) {
|
if (drci_rd_reg(usb_device, DRCI_REG_HW_ADDR_MI, &mi)) {
|
||||||
dev_err(dev, "Vendor request 'hw_addr_mid' failed\n");
|
dev_err(dev, "Vendor request 'hw_addr_mid' failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drci_rd_reg(usb_device, DRCI_REG_HW_ADDR_LO, &lo) < 0) {
|
if (drci_rd_reg(usb_device, DRCI_REG_HW_ADDR_LO, &lo)) {
|
||||||
dev_err(dev, "Vendor request 'hw_addr_low' failed\n");
|
dev_err(dev, "Vendor request 'hw_addr_low' failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drci_rd_reg(usb_device, DRCI_REG_NI_STATE, &link) < 0) {
|
if (drci_rd_reg(usb_device, DRCI_REG_NI_STATE, &link)) {
|
||||||
dev_err(dev, "Vendor request 'link status' failed\n");
|
dev_err(dev, "Vendor request 'link status' failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user