diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c index 8501ff642..337949fa1 100644 --- a/spa/plugins/alsa/alsa-udev.c +++ b/spa/plugins/alsa/alsa-udev.c @@ -477,15 +477,9 @@ static int emit_object_info(struct impl *this, struct device *device) if ((str = udev_device_get_property_value(dev, "SUBSYSTEM")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SUBSYSTEM, str); } - if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str) { - char *dec = alloca(6); /* 65535 is max */ - int32_t val; + if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str) + items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, str); - if (spa_atoi32(str, &val, 16)) { - snprintf(dec, 6, "%d", val); - items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, dec); - } - } str = udev_device_get_property_value(dev, "ID_VENDOR_FROM_DATABASE"); if (!(str && *str)) { str = udev_device_get_property_value(dev, "ID_VENDOR_ENC"); @@ -500,15 +494,9 @@ static int emit_object_info(struct impl *this, struct device *device) if (str && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_NAME, str); } - if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str) { - char *dec = alloca(6); /* 65535 is max */ - int32_t val; + if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str) + items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, str); - if (spa_atoi32(str, &val, 16)) { - snprintf(dec, 6, "%d", val); - items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, dec); - } - } str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE"); if (!(str && *str)) { str = udev_device_get_property_value(dev, "ID_MODEL_ENC"); diff --git a/spa/plugins/v4l2/v4l2-udev.c b/spa/plugins/v4l2/v4l2-udev.c index ff5433e08..6a42709e3 100644 --- a/spa/plugins/v4l2/v4l2-udev.c +++ b/spa/plugins/v4l2/v4l2-udev.c @@ -278,15 +278,9 @@ static int emit_object_info(struct impl *this, struct device *device) if ((str = udev_device_get_property_value(dev, "SUBSYSTEM")) && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_SUBSYSTEM, str); } - if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str) { - char *dec = alloca(6); /* 65535 is max */ - int32_t val; + if ((str = udev_device_get_property_value(dev, "ID_VENDOR_ID")) && *str) + items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, str); - if (spa_atoi32(str, &val, 16)) { - snprintf(dec, 6, "%d", val); - items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_ID, dec); - } - } str = udev_device_get_property_value(dev, "ID_VENDOR_FROM_DATABASE"); if (!(str && *str)) { str = udev_device_get_property_value(dev, "ID_VENDOR_ENC"); @@ -301,15 +295,8 @@ static int emit_object_info(struct impl *this, struct device *device) if (str && *str) { items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_VENDOR_NAME, str); } - if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str) { - char *dec = alloca(6); /* 65535 is max */ - int32_t val; - - if (spa_atoi32(str, &val, 16)) { - snprintf(dec, 6, "%d", val); - items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, dec); - } - } + if ((str = udev_device_get_property_value(dev, "ID_MODEL_ID")) && *str) + items[n_items++] = SPA_DICT_ITEM_INIT(SPA_KEY_DEVICE_PRODUCT_ID, str); str = udev_device_get_property_value(dev, "ID_MODEL_FROM_DATABASE"); if (!(str && *str)) {