usb: core: let dynamic ids override static ids
authorBjørn Mork <bjorn@mork.no>
Sat, 11 Jan 2014 01:04:00 +0000 (02:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Feb 2014 22:24:24 +0000 (14:24 -0800)
This modifies the probing order so that any matching
dynamic entry always will be used, even if the driver
has a matching static entry.

It is sometimes useful to dynamically update existing
device entries. With the new ability to set the dynamic
entry driver_info field, this can be used to test new
additions to class driver exception lists or proposed
changes to existing static per-device driver_info
entries.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/core/driver.c

index 5d01558cef666233b47f29d569595a1f42dda8b2..9cd218135087e6603adee9048f950f34d248be47 100644 (file)
@@ -302,9 +302,9 @@ static int usb_probe_interface(struct device *dev)
                return error;
        }
 
-       id = usb_match_id(intf, driver->id_table);
+       id = usb_match_dynamic_id(intf, driver);
        if (!id)
-               id = usb_match_dynamic_id(intf, driver);
+               id = usb_match_id(intf, driver->id_table);
        if (!id)
                return error;