chiark / gitweb /
udev: hwdb - try reading modalias for usb before falling back to the composed one
authorKay Sievers <kay@vrfy.org>
Wed, 7 Aug 2013 11:10:01 +0000 (13:10 +0200)
committerKay Sievers <kay@vrfy.org>
Wed, 7 Aug 2013 14:47:31 +0000 (16:47 +0200)
src/udev/udev-builtin-hwdb.c

index f1c0ca9..d6aa96b 100644 (file)
@@ -102,14 +102,13 @@ static int udev_builtin_hwdb_search(struct udev_device *dev, struct udev_device
                 if (subsystem && !streq(dsubsys, subsystem))
                         continue;
 
+                modalias = udev_device_get_property_value(d, "MODALIAS");
+
                 /* the usb_device does not have a modalias, compose one */
-                if (streq(dsubsys, "usb"))
+                if (!modalias && streq(dsubsys, "usb"))
                         modalias = modalias_usb(d, s, sizeof(s));
 
                 if (!modalias)
-                        modalias = udev_device_get_property_value(d, "MODALIAS");
-
-                if (!modalias)
                         continue;
 
                 n = udev_builtin_hwdb_lookup(dev, prefix, modalias, filter, test);