config/udev: Prefer product name from attribute rather than uevent
The input device product name for evdev devices in the kernel uevent has embedded quotes that aren't expected here. Use the sysfs name attribute instead, which does not suffer this problem. The uevent name will be used as a fallback if no name attribute is found. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
		
							parent
							
								
									d00c3298a6
								
							
						
					
					
						commit
						aa91508356
					
				|  | @ -73,8 +73,11 @@ device_added(struct udev_device *udev_device) | |||
|         goto unwind; | ||||
| 
 | ||||
|     parent = udev_device_get_parent(udev_device); | ||||
|     if (parent) | ||||
|         name = udev_device_get_property_value(parent, "NAME"); | ||||
|     if (parent) { | ||||
|         name = udev_device_get_sysattr_value(parent, "name"); | ||||
|         if (!name) | ||||
|             name = udev_device_get_property_value(parent, "NAME"); | ||||
|     } | ||||
|     if (!name) | ||||
|         name = "(unnamed)"; | ||||
|     else | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue