From 91b9dcfde39cb544782dba99ad10282b49df1a08 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 7 Aug 2013 13:10:01 +0200 Subject: udev: hwdb - try reading modalias for usb before falling back to the composed one --- src/udev/udev-builtin-hwdb.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c index f1c0ca9cb1..d6aa96bb3d 100644 --- a/src/udev/udev-builtin-hwdb.c +++ b/src/udev/udev-builtin-hwdb.c @@ -102,13 +102,12 @@ 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; -- cgit v1.2.3-54-g00ecf