Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 298270 Details for
Bug 437637
sensors_init: Kernel interface error
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
PATCH: Recognize and properly handle virtual hwmon devices
lm_sensors-3.0.1-virtual-dev-v2.patch (text/plain), 3.90 KB, created by
Jean Delvare
on 2008-03-17 14:59:01 UTC
(
hide
)
Description:
PATCH: Recognize and properly handle virtual hwmon devices
Filename:
MIME Type:
Creator:
Jean Delvare
Created:
2008-03-17 14:59:01 UTC
Size:
3.90 KB
patch
obsolete
>Index: lib/sensors.h >=================================================================== >--- lib/sensors.h (revision 5145) >+++ lib/sensors.h (working copy) >@@ -30,7 +30,7 @@ > when the API + ABI breaks), the third digit is incremented to track small > API additions like new flags / enum values. The second digit is for tracking > larger additions like new methods. */ >-#define SENSORS_API_VERSION 0x400 >+#define SENSORS_API_VERSION 0x401 > > #define SENSORS_CHIP_NAME_PREFIX_ANY NULL > #define SENSORS_CHIP_NAME_ADDR_ANY -1 >@@ -40,6 +40,7 @@ > #define SENSORS_BUS_TYPE_ISA 1 > #define SENSORS_BUS_TYPE_PCI 2 > #define SENSORS_BUS_TYPE_SPI 3 >+#define SENSORS_BUS_TYPE_VIRT 4 > #define SENSORS_BUS_NR_ANY (-1) > #define SENSORS_BUS_NR_IGNORE (-2) > >Index: lib/access.c >=================================================================== >--- lib/access.c (revision 5145) >+++ lib/access.c (working copy) >@@ -344,6 +344,8 @@ > so we don't have any custom string to return. */ > case SENSORS_BUS_TYPE_SPI: > return "SPI adapter"; >+ case SENSORS_BUS_TYPE_VIRT: >+ return "Virtual device"; > } > > /* bus types with several instances */ >Index: lib/sysfs.c >=================================================================== >--- lib/sysfs.c (revision 5145) >+++ lib/sysfs.c (working copy) >@@ -475,6 +475,14 @@ > if (!entry.chip.path) > sensors_fatal_error(__func__, "Out of memory"); > >+ if (dev_path == NULL) { >+ /* Virtual device */ >+ entry.chip.addr = 0; >+ entry.chip.bus.type = SENSORS_BUS_TYPE_VIRT; >+ entry.chip.bus.nr = 0; >+ goto done; >+ } >+ > /* Find bus type */ > snprintf(linkpath, NAME_MAX, "%s/subsystem", dev_path); > sub_len = readlink(linkpath, subsys_path, NAME_MAX - 1); >@@ -543,6 +551,7 @@ > goto exit_free; > } > >+done: > if (sensors_read_dynamic_chip(&entry, hwmon_path) < 0) > goto exit_free; > if (!entry.subfeature) { /* No subfeature, discard chip */ >@@ -591,16 +600,20 @@ > > snprintf(linkpath, NAME_MAX, "%s/device", path); > dev_len = readlink(linkpath, device, NAME_MAX - 1); >- if (dev_len < 0) >- return -SENSORS_ERR_KERNEL; >- device[dev_len] = '\0'; >- device_p = strrchr(device, '/') + 1; >+ if (dev_len < 0) { >+ /* No device link? Treat as virtual */ >+ err = sensors_read_one_sysfs_chip(NULL, NULL, path); >+ } else { >+ device[dev_len] = '\0'; >+ device_p = strrchr(device, '/') + 1; > >- /* The attributes we want might be those of the hwmon class device, >- or those of the device itself. */ >- err = sensors_read_one_sysfs_chip(linkpath, device_p, path); >- if (err == 0) >- err = sensors_read_one_sysfs_chip(linkpath, device_p, linkpath); >+ /* The attributes we want might be those of the hwmon class >+ device, or those of the device itself. */ >+ err = sensors_read_one_sysfs_chip(linkpath, device_p, path); >+ if (err == 0) >+ err = sensors_read_one_sysfs_chip(linkpath, device_p, >+ linkpath); >+ } > if (err < 0) > return err; > return 0; >Index: lib/data.c >=================================================================== >--- lib/data.c (revision 5145) >+++ lib/data.c (working copy) >@@ -108,6 +108,8 @@ > res->bus.type = SENSORS_BUS_TYPE_PCI; > else if (!strncmp(name, "spi", dash - name)) > res->bus.type = SENSORS_BUS_TYPE_SPI; >+ else if (!strncmp(name, "virtual", dash - name)) >+ res->bus.type = SENSORS_BUS_TYPE_VIRT; > else > goto ERROR; > name = dash + 1; >@@ -168,6 +170,9 @@ > case SENSORS_BUS_TYPE_SPI: > return snprintf(str, size, "%s-spi-%hd-%x", chip->prefix, > chip->bus.nr, chip->addr); >+ case SENSORS_BUS_TYPE_VIRT: >+ return snprintf(str, size, "%s-virtual-%x", chip->prefix, >+ chip->addr); > } > > return -SENSORS_ERR_CHIP_NAME; >Index: Makefile >=================================================================== >--- Makefile (revision 5145) >+++ Makefile (working copy) >@@ -79,7 +79,7 @@ > MACHINE := $(shell uname -m) > > # Extra non-default programs to build; e.g., sensord >-# PROG_EXTRA := sensord >+PROG_EXTRA := sensord > > # Set these to add preprocessor or compiler flags, or use > # environment variables
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 437637
:
298182
|
298183
| 298270