Skip to content

Commit

Permalink
Fix hwmon channel type set to unknown if !WITH_HWMON
Browse files Browse the repository at this point in the history
Libiio being compiled without support for hwmon devices means that the
local backend won't try to probe hwmon devices; but hwmon devices found
by a remote libiio should still be usable across the network or USB,
even if WITH_HWMON is disabled locally.

Until now if the host libiio was compiled without hwmon support, it
could see the target's hwmon devices but their type was wrong.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reported-by: Adrian Suciu <adrian.suciu@analog.com>
  • Loading branch information
pcercuei committed Feb 1, 2022
1 parent 5b4cd21 commit 2b9fb23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void iio_channel_init_finalize(struct iio_channel *chn)
char *mod;
int type;

if (WITH_HWMON && iio_device_is_hwmon(chn->dev)) {
if (iio_device_is_hwmon(chn->dev)) {
type = iio_channel_find_type(chn->id, hwmon_chan_type_name_spec,
ARRAY_SIZE(hwmon_chan_type_name_spec));
} else {
Expand Down

0 comments on commit 2b9fb23

Please sign in to comment.