summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c
index 55ebf1b54..a20c114a1 100644
--- a/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c
+++ b/v4l2-apps/libv4l/libv4lconvert/control/libv4lcontrol.c
@@ -169,11 +169,19 @@ static void v4lcontrol_get_dmi_string(const char *string, char *buf, int size)
char *s, sysfs_name[512];
snprintf(sysfs_name, sizeof(sysfs_name),
- "/sys/devices/virtual/dmi/id/%s", string);
+ "/sys/class/dmi/id/%s", string);
f = fopen(sysfs_name, "r");
if (!f) {
- buf[0] = 0;
- return;
+ /* Try again with a different sysfs path, not sure if this is needed
+ but we used to look under /sys/devices/virtual/dmi/id in older
+ libv4l versions, but this did not work with some kernels */
+ snprintf(sysfs_name, sizeof(sysfs_name),
+ "/sys/devices/virtual/dmi/id/%s", string);
+ f = fopen(sysfs_name, "r");
+ if (!f) {
+ buf[0] = 0;
+ return;
+ }
}
s = fgets(buf, size, f);