mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-08 16:11:26 +00:00
Support more bus types (part 2 of 2). Originally libsensors was very
i2c-centric. Make it more neutral so that we can cleanly support additional bus types such as SPI or One-Wire. This second part updates sensors_bus to use sensors_bus_id. Thanks to Mark M. Hoffman for showing me how the configuration file parser could be modified to support that change. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4687 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
7ee15371df
commit
a74addb5d4
5 files changed
+24
-21
No files matched your search
+3
-2
@@ -380,9 +380,10 @@ int sensors_read_sysfs_bus(void)
|
||||
(attr = sysfs_get_device_attr(dev, "name"))))
|
||||
continue;
|
||||
|
||||
if (sscanf(clsdev->name, "i2c-%d", &entry.number) != 1 ||
|
||||
entry.number == 9191) /* legacy ISA */
|
||||
if (sscanf(clsdev->name, "i2c-%hd", &entry.bus.nr) != 1 ||
|
||||
entry.bus.nr == 9191) /* legacy ISA */
|
||||
continue;
|
||||
entry.bus.type = SENSORS_BUS_TYPE_I2C;
|
||||
|
||||
/* NB: attr->value[attr->len-1] == '\n'; chop that off */
|
||||
entry.adapter = strndup(attr->value, attr->len - 1);
|
||||
|
||||
Reference in new issue
Block a user