udev-util: add generic device_get_{vendor,model}_string() helpers
We chck the same props in various places, add a single implementation of a call to inquire this.
This commit is contained in:
+1
-3
@@ -516,9 +516,7 @@ static int device_update_description(Unit *u, sd_device *dev, const char *path)
|
||||
|
||||
desc = path;
|
||||
|
||||
if (dev &&
|
||||
(sd_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE", &model) >= 0 ||
|
||||
sd_device_get_property_value(dev, "ID_MODEL", &model) >= 0)) {
|
||||
if (dev && device_get_model_string(dev, &model) >= 0) {
|
||||
desc = model;
|
||||
|
||||
/* Try to concatenate the device model string with a label, if there is one */
|
||||
|
||||
Reference in New Issue
Block a user