mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 18:23:53 +08:00
usb: phy: ab8500: silence some uninitialized variable warnings
Smatch complains that "reg" can be uninitialized if the abx500_get_register_interruptible() call fails. It's an interruptable function, so we should check if the user presses CTRL-C. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6494a9ad86
commit
b8d9ee2449
@ -505,15 +505,19 @@ static int abx500_usb_link_status_update(struct ab8500_usb *ab)
|
|||||||
if (is_ab8500(ab->ab8500)) {
|
if (is_ab8500(ab->ab8500)) {
|
||||||
enum ab8500_usb_link_status lsts;
|
enum ab8500_usb_link_status lsts;
|
||||||
|
|
||||||
abx500_get_register_interruptible(ab->dev,
|
ret = abx500_get_register_interruptible(ab->dev,
|
||||||
AB8500_USB, AB8500_USB_LINE_STAT_REG, ®);
|
AB8500_USB, AB8500_USB_LINE_STAT_REG, ®);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
lsts = (reg >> 3) & 0x0F;
|
lsts = (reg >> 3) & 0x0F;
|
||||||
ret = ab8500_usb_link_status_update(ab, lsts);
|
ret = ab8500_usb_link_status_update(ab, lsts);
|
||||||
} else if (is_ab8505(ab->ab8500)) {
|
} else if (is_ab8505(ab->ab8500)) {
|
||||||
enum ab8505_usb_link_status lsts;
|
enum ab8505_usb_link_status lsts;
|
||||||
|
|
||||||
abx500_get_register_interruptible(ab->dev,
|
ret = abx500_get_register_interruptible(ab->dev,
|
||||||
AB8500_USB, AB8505_USB_LINE_STAT_REG, ®);
|
AB8500_USB, AB8505_USB_LINE_STAT_REG, ®);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
lsts = (reg >> 3) & 0x1F;
|
lsts = (reg >> 3) & 0x1F;
|
||||||
ret = ab8505_usb_link_status_update(ab, lsts);
|
ret = ab8505_usb_link_status_update(ab, lsts);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user