| 74 | | if (sscanf(dev->name, "%d-%x", &entry.name.bus, &entry.name.addr) != 2) |
|---|
| | 74 | if (sscanf(dev->name, "%d-%x", &entry.name.bus, &entry.name.addr) == 2) { |
|---|
| | 75 | /* find out if legacy ISA or not */ |
|---|
| | 76 | snprintf(bus_path, sizeof(bus_path), |
|---|
| | 77 | "%s/class/i2c-adapter/i2c-%d/device/name", |
|---|
| | 78 | sensors_sysfs_mount, entry.name.bus); |
|---|
| | 79 | |
|---|
| | 80 | if ((bus_attr = sysfs_open_attribute(bus_path))) { |
|---|
| | 81 | if (sysfs_read_attribute(bus_attr)) |
|---|
| | 82 | return -SENSORS_ERR_PARSE; |
|---|
| | 83 | |
|---|
| | 84 | if (bus_attr->value && !strncmp(bus_attr->value, "ISA ", 4)) |
|---|
| | 85 | entry.name.bus = SENSORS_CHIP_NAME_BUS_ISA; |
|---|
| | 86 | |
|---|
| | 87 | sysfs_close_attribute(bus_attr); |
|---|
| | 88 | } |
|---|
| | 89 | } else if (sscanf(dev->name, "%*[a-z0-9_].%d", &entry.name.addr) == 1) { |
|---|
| | 90 | /* must be new ISA (platform driver) */ |
|---|
| | 91 | entry.name.bus = SENSORS_CHIP_NAME_BUS_ISA; |
|---|
| | 92 | } else |
|---|
| 76 | | |
|---|
| 77 | | /* find out if ISA or not */ |
|---|
| 78 | | snprintf(bus_path, sizeof(bus_path), |
|---|
| 79 | | "%s/class/i2c-adapter/i2c-%d/device/name", |
|---|
| 80 | | sensors_sysfs_mount, entry.name.bus); |
|---|
| 81 | | |
|---|
| 82 | | if ((bus_attr = sysfs_open_attribute(bus_path))) { |
|---|
| 83 | | if (sysfs_read_attribute(bus_attr)) |
|---|
| 84 | | return -SENSORS_ERR_PARSE; |
|---|
| 85 | | |
|---|
| 86 | | if (bus_attr->value && !strncmp(bus_attr->value, "ISA ", 4)) |
|---|
| 87 | | entry.name.bus = SENSORS_CHIP_NAME_BUS_ISA; |
|---|
| 88 | | |
|---|
| 89 | | sysfs_close_attribute(bus_attr); |
|---|
| 90 | | } |
|---|