diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect index 0fc5f6fb..a60674f0 100755 --- a/prog/detect/sensors-detect +++ b/prog/detect/sensors-detect @@ -2199,7 +2199,10 @@ sub initialize_i2c_adapters_list # The layout in sysfs has changed over the years if ($have_i2c_adapter_class) { my $link = readlink("${base_dir}/i2c-$nr/device"); - if ($link =~ m/^(.*)\/i2c-$nr$/) { + if (!defined $link) { + $entry->{path} = "${base_dir}/i2c-$nr"; + $entry->{parent} = "${base_dir}/i2c-$nr"; + } elsif ($link =~ m/^(.*)\/i2c-$nr$/) { $entry->{path} = "${base_dir}/i2c-$nr/device"; $entry->{parent} = "${base_dir}/i2c-$nr/$1"; } else {