Add support for dev_name formatted like "a000000.wifi"

This commit is contained in:
7217043955 authored and GitHub committed 2022-09-06 15:48:11 +08:00
1 parent 42f240d2a4
commit 6da486d741
1 file changed
+3 -2
+3 -2
View File
@@ -663,8 +663,9 @@ static int classify_device(const char *dev_name,
if ((!subsys || !strcmp(subsys, "platform") ||
!strcmp(subsys, "of_platform"))) {
/* must be new ISA (platform driver) */
if (sscanf(dev_name, "%*[a-zA-Z0-9_]%*1[.:]%d", &entry->chip.addr) != 1)
entry->chip.addr = 0;
if (sscanf(dev_name, "%*[a-zA-Z0-9_]%*1[.:]%d", &entry->chip.addr) == 1);
else if (sscanf(dev_name, "%x.%*s", &entry->chip.addr) == 1);
else entry->chip.addr = 0;
entry->chip.bus.type = SENSORS_BUS_TYPE_ISA;
entry->chip.bus.nr = 0;
} else if (subsys && !strcmp(subsys, "acpi")) {