udev-device: fix offset of vendor id of hidraw devices

The read property from hidraw HID_ID is 0018:00002D1F:00004946 where
the vendor id 2D1F starts from offset 9 from base address.

This change probes the hidraw vid/pid with a wanted plugin properly.
This commit is contained in:
Crag.Wang 2019-11-06 13:51:43 +08:00 committed by Richard Hughes
parent 85fb312563
commit 640c81a496

View File

@ -152,7 +152,7 @@ fu_udev_device_probe (FuDevice *device, GError **error)
g_strcmp0 (priv->subsystem, "hidraw") == 0) {
tmp = g_udev_device_get_property (udev_parent, "HID_ID");
if (tmp != NULL && strlen (tmp) == 22) {
priv->vendor = fu_udev_device_read_uint16 (tmp + 10);
priv->vendor = fu_udev_device_read_uint16 (tmp + 9);
priv->model = fu_udev_device_read_uint16 (tmp + 18);
}
tmp = g_udev_device_get_property (udev_parent, "HID_NAME");