usb: Resolve warnings about unassigned bus on usb device creation

When creating an USB device the old way, there is no way to specify the
target bus. Thus the warning issued by usb_create makes no sense and
rather confuses our users.

Resolve this by passing a bus reference to the usbdevice_init handler
and letting those handlers forward it to usb_create.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Jan Kiszka 2012-02-27 15:18:47 +01:00 committed by Gerd Hoffmann
parent e64722108c
commit 3741715cf2
9 changed files with 26 additions and 34 deletions

View file

@ -1443,13 +1443,13 @@ static void usb_host_register_types(void)
type_init(usb_host_register_types)
USBDevice *usb_host_device_open(const char *devname)
USBDevice *usb_host_device_open(USBBus *bus, const char *devname)
{
struct USBAutoFilter filter;
USBDevice *dev;
char *p;
dev = usb_create(NULL /* FIXME */, "usb-host");
dev = usb_create(bus, "usb-host");
if (strstr(devname, "auto:")) {
if (parse_filter(devname, &filter) < 0) {