usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del
PATCH 1/1 usb: Use usb_bus_find(-1) instead of usb_enabled() in usb_device_add/usb_device_del
Without usb=on machine option, usb_device_add/usb_device_del don't work, Even if there are virtual usb controllers presented.
This patch fixes it.
Signed-off-by Lin Ma <[email protected]>
--- vl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
vl.c +2 -2
@@ -1234,7 +1234,7 @@ static int usb_device_add(const char *devname)const char *p;#endif -if (!usb_enabled ()) { +if (!usb_bus_find (-1 )) {return -1 ; }
@@ -1266,7 +1266,7 @@ static int usb_device_del(const char *devname)return -1 ; } -if (!usb_enabled ()) { +if (!usb_bus_find (-1 )) {return -1 ; }
Signature · 1 line
2.1.4
Quoted 2 lines · Lin Ma
Without usb=on machine option, usb_device_add/usb_device_del don't work, Even if there are virtual usb controllers presented.
If you use -device to add your usb host controllers, you should likewise use -device (or device_add monitor cmd) to add your usb devices.
-usbdevice is legacy syntax and only there for backward compatibility.
cheers,
Gerd