2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-28 21:07:55 +00:00

171 Commits

Author SHA1 Message Date
Jean Delvare
78f496ca62 libsensors: New method to free the memory allocated for the internal
representation of chip names.
sensord, sensors: Fix a memory leak when one or more chip names are
provided on the command line.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5740 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-06-20 10:04:52 +00:00
Jean Delvare
e675ad35c9 Removed trailing semicolon in error string. Patch from Andre Prendel.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5632 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-29 09:45:25 +00:00
Jean Delvare
6ed5aa3a0a Consistently use "err" as the variable name to carry error codes.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5628 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-28 13:16:17 +00:00
Jean Delvare
496b15a644 Fix exit code in error case (for example no sensors found.) Patch from
Andre Prendel.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5627 7894878c-1315-0410-8ee3-d5d059ff63e0
2009-01-28 13:10:21 +00:00
Jean Delvare
f2e518511d Patch from Aurelien Jarno:
I have just noticed that the FSF address is the old one in all files
except COPYING. Please find a patch below to fix that.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5163 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-03-26 13:37:12 +00:00
Jean Delvare
7a2649483e Fix error path on library initialization error. Only call fclose() if
we have actually opened a configuration file before.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5090 7894878c-1315-0410-8ee3-d5d059ff63e0
2008-01-05 09:14:28 +00:00
Jean Delvare
f17e1cf5a8 "sensors" no longer needs a default configuration file name. If no
file name is provided on the command line, use the libsensors default.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4986 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-25 09:49:34 +00:00
Jean Delvare
2b1c2a0e6f sensors: Fix file handle leak on library initialization error.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4973 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-10-21 14:31:38 +00:00
Jean Delvare
647b47cb6a Add my copyright everywhere it is missing.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4902 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-29 19:18:15 +00:00
Jean Delvare
ab36c5b0f8 Delete unused SENSORS_ERR_ACCESS.
Rename SENSORS_ERR_PROC to the more neutral SENSORS_ERR_KERNEL.
Introduce SENSORS_ERR_NO_DEVS for finer-grained error reporting.
Use SENSORS_ERR_KERNEL and SENSORS_ERR_NO_DEVS where appropriate.
No error message for invalid error codes.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4854 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-23 13:53:11 +00:00
Jean Delvare
8f352d518c New sensors option: --bus-list. This option lists i2c buses that are
used by sensor chips on the running system, in a format suitable for
sensors.conf. This is a replacement for the old, broken grab_busses.sh
script. Benefits of having this directly in sensors:
* It lists only the i2c buses that are relevant to sensors.
* sensors is installed by default, while most people didn't have
  access to grab_busses.sh.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4781 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-09-05 21:19:45 +00:00
Jean Delvare
2ee12591df Remove "generic" from all printing function names. This is the default
mode now so no need to mention it explicitly.
Rename print_vid_info to print_chip_vid and move it around for
consistency.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4728 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 21:26:20 +00:00
Jean Delvare
7ba794d9ba Clean up the global variables:
* do_sets, do_raw and hide_adapter are only used in main.c and could
thus be declared static.
* fahrenheit and degstr are used in chips.c as well, so they should be
declared in a header file.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4713 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:24:46 +00:00
Jean Delvare
55291db894 Reorder the functions so as to get rid of unneeded forward
declarations.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4712 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:22:28 +00:00
Jean Delvare
364bd24c44 config_file doesn't need to be a global. Also move the handling of
the configuration file in a single separate function for clarity.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4711 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 13:21:05 +00:00
Jean Delvare
c649ae5ac3 Merge chips_generic.c into chips.c. The boundary between both files was
only historical, and prevents us from doing a number of cleanups.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4710 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 12:19:07 +00:00
Jean Delvare
252c5faf86 Mass reindent and coding style cleanups.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4708 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 10:57:16 +00:00
Jean Delvare
c91457b7de Executing the set statements is an exclusive action.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4706 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:57:48 +00:00
Jean Delvare
5ba408a37f Merge most of the usage help text into a single string. This is way
more efficient.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4705 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:43:30 +00:00
Jean Delvare
ec8ba95b53 Refactor the configuration file path.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4704 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:42:20 +00:00
Jean Delvare
b8b417c51e Thanks to the new prototype of sensors_get_detected_chips, we no
longer need to build an array from the chip names passed on the
command line. Instead, we can process them one after the other
directly. This saves some memory and allows for minor code cleanups.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4703 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:28:10 +00:00
Jean Delvare
4d6bec8bb2 Add a parameter to sensors_get_detected_chips(), to optionally let the
caller select which subset of chips it wants. This is slightly better
size-wise than letting all applications do the filtering by themselves.

This will change the way the command line parameters of "sensors" are
interpreted. Beforehand, the chips were always returned in the order
in which they were listed by the library. Also, each chip could be listed
only once. From now on, the chips will be listed in the order in which
they are passed on the command line, which I think makes more sense. A
side effect is that chips can be listed more than once, if that's what
the user asks for. Not very useful though.

This change makes it possible to make sensors_match_chip() internal
to the library. Filtering the list of chips returned by
sensors_get_detected_chips() was the last known external use for this
function.

This patch looks much bigger than it really is, but the largest part is
really only code reindentation.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4701 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-26 08:26:20 +00:00
Jean Delvare
bf1ff10ab4 Relabel "sensors -u" from "unknown chip" to "raw chip". sensors uses generic
code to display all the chips now so the notion of "unknown chip" no longer
exists, however this raw output format can still be useful for debugging.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4698 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-23 07:45:58 +00:00
Jean Delvare
90c2942bef Drop sensors option -U, --hide-unknown. libsensors no longer exposes
chips with no features, and it builds the features list dynamically, so
applications no longer get to see unknown chips.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4697 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-22 18:43:48 +00:00
Jean Delvare
7ee15371df Support more bus types (part 1 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 first part introduces sensors_bus_id, and updates
sensors_chip_name to use it.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4686 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-19 15:03:50 +00:00
Jean Delvare
557feb2696 Fix error message when a chip is specified on the command line
with no prefix and that chip isn't found.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4681 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-17 11:36:01 +00:00
Jean Delvare
edb42b3c16 Add a new function to libsensors doing the opposite of
sensors_parse_chip_name(). sensors_snprintf_chip_name() converts
a chip name from its internal representation to a human readable
string. So far, each user program had to reimplement this function.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4676 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 10:04:57 +00:00
Jean Delvare
b52225ffc0 Drop support for "dummy" bus type. The kernel no longer supports
such fake i2c buses, so neither should we. Instead, non-i2c buses are
handled explicitly.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4672 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-16 09:54:53 +00:00
Jean Delvare
3b25c8dc22 Pass structures by reference in sensors and sensord, again for a
small performance gain and better consistency with the new
libsensors API.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4668 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-13 20:19:44 +00:00
Jean Delvare
3bab00fff9 Change the libsensors API so that all structures are passed by
reference. This is more efficient that way.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4666 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-08-13 20:16:03 +00:00
Jean Delvare
7b8fdf0188 Advertise and document libsensors_version.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4602 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-10 19:55:06 +00:00
Jean Delvare
b79274babd Add some more warning flags, and fix these warnings.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4545 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-07-03 16:03:22 +00:00
Jean Delvare
4c905e1632 Drop the --generic option. This is the default now, so the option has
no effect.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4512 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 17:47:18 +00:00
Jean Delvare
6a6cf217d4 Drop all the chip-specific handling and printing code from sensors. The
generic printing code should work now, and what doesn't work, will get
fixed.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4503 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-28 08:52:37 +00:00
Jean Delvare
24f6b62c3f Delete all remnants of algorithm names.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4465 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 14:21:01 +00:00
Jean Delvare
f00aef9271 Return with an explicit error code/message if sysfs isn't mounted.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4464 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-06-25 13:58:55 +00:00
Jean Delvare
139afe6665 Disable specific support for the ds1621, lm90 and f71805f drivers.
I tested that the generic support works fine for these devices.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4424 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-05-28 15:02:18 +00:00
Hans de Goede
16408d8665 -comment abituguru entry in lib/chips.c and prog/sensors/main.c, as the
abituguru seems to work well with the new dynamic chip support and generic
 chip printroutines. note: the abituguru code should be completly removed in
 the future.
-comment k8temp entry in lib/chips.c and prog/sensors/main.c, as the
 k8temp seems to work well with the new dynamic chip support and generic
 chip printroutines. note: the k8temp code should be completly removed in
 the future.
-make the match for the subtype exact instead of a strncmp, otherwise
 an alarm_enable flag gets classified as an alarm, leading to all sensors who
 have their alarm enabled getting an alarm reported, as the alarm_enabled gets
 read as alarm.
-and do the same for the _input match to check if this is a main or subfeature


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4367 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-09 18:07:07 +00:00
Hans de Goede
d871e17ccf generic chip printing routine for sensors prog, by Bob Schlarmann and Luuk Kleiweg
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4362 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-09 14:43:29 +00:00
Mark M. Hoffman
c5ffa7b635 Merge from trunk (4303:4355) out to 3.0.0 branch.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4357 7894878c-1315-0410-8ee3-d5d059ff63e0
2007-04-03 12:55:30 +00:00
Jean Delvare
73922b2883 Add user-space support for the ADM1029. Patch contributed by
Corentin Labbe.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4270 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-22 21:11:07 +00:00
Jean Delvare
6310ee1f03 Add support for the w83627dhg. Original patch by David Holl.
This closes ticket #2157.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4264 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-12-18 07:43:00 +00:00
Jean Delvare
53cb805e44 Add user-space support for the Fintek F71872F/FG (chip name f71872f).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4232 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-11-12 13:17:32 +00:00
Rudolf Marek
2b3d98a880 Add the coretemp driver userspace support.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4214 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-10-15 19:26:10 +00:00
Jean Delvare
054b265795 Really ignore option -a.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4207 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-10-13 17:18:06 +00:00
Jean Delvare
4e7c982027 sensors: Drop option -a (show algorithm names).
The algorithm names are no more available since Linux 2.6, and were not
very useful anyway.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4206 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-10-13 13:01:10 +00:00
Jean Delvare
7891d63259 sensors: Handle option -c more efficiently.
We don't need to strdup() the file names, we can use them directly.
As a side effect, this fixes a memory leak which was happening if
option -c was specified more than once on the command line.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4205 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-10-13 12:43:43 +00:00
Jean Delvare
6b5b092e9c libsensors: Add support for the pc87247 driver (fans only).
sensord: Add pc87247 support (fans only).
sensors: Add pc87247 support (fans only).
sensors-detect: Advertise the upcoming pc87427 driver.
Thanks to Amir Habibi at Candelis for setting up a test system.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4196 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-10-06 09:27:56 +00:00
Jean Delvare
94fa667c46 libsensors: Missing sysfs busses and classes are not errors. This tends
to confuse users a lot, to report the lack of hwmon driver as an error.
prog/sensors: Clearer error messages when no sensors are found. The
most frequent cause is a lack of drivers, not procfs/sysfs problems.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4159 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-09-19 10:01:12 +00:00
Jean Delvare
8c235d29a9 Add userspace support for the Winbond W83793. Patch contributed by
Yuan Mu (Winbond.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4109 7894878c-1315-0410-8ee3-d5d059ff63e0
2006-08-24 18:13:20 +00:00