diff options
Diffstat (limited to 'vl.c')
-rw-r--r-- | vl.c | 26 |
1 files changed, 18 insertions, 8 deletions
@@ -5809,22 +5809,15 @@ static int usb_device_add(const char *devname) return 0; } -static int usb_device_del(const char *devname) +int usb_device_del_addr(int bus_num, int addr) { USBPort *port; USBPort **lastp; USBDevice *dev; - int bus_num, addr; - const char *p; if (!used_usb_ports) return -1; - p = strchr(devname, '.'); - if (!p) - return -1; - bus_num = strtoul(devname, NULL, 0); - addr = strtoul(p + 1, NULL, 0); if (bus_num != 0) return -1; @@ -5847,6 +5840,23 @@ static int usb_device_del(const char *devname) return 0; } +static int usb_device_del(const char *devname) +{ + int bus_num, addr; + const char *p; + + if (!used_usb_ports) + return -1; + + p = strchr(devname, '.'); + if (!p) + return -1; + bus_num = strtoul(devname, NULL, 0); + addr = strtoul(p + 1, NULL, 0); + + return usb_device_del_addr(bus_num, addr); +} + void do_usb_add(const char *devname) { int ret; |