]> www.infradead.org Git - users/jedix/linux-maple.git/commit
hwmon: iio: Add labels from IIO channels
authorSean Anderson <sean.anderson@linux.dev>
Mon, 24 Jun 2024 17:46:01 +0000 (13:46 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 28 Jun 2024 19:07:18 +0000 (20:07 +0100)
commit440db4075fa0cb517bb18ea7ec555d927f8fc030
treefd9f910882ebac9fee4a9352f35b08d3abd9afcc
parent0214b27fc949a7bcaf57e71a7f9f534d6481d08b
hwmon: iio: Add labels from IIO channels

Add labels from IIO channels to our channels. This allows userspace to
display more meaningful names instead of "in0" or "temp5".

Although lm-sensors gracefully handles errors when reading channel
labels, the ABI says the label attribute

> Should only be created if the driver has hints about what this voltage
> channel is being used for, and user-space doesn't.

Therefore, we test to see if the channel has a label before
creating the attribute.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://patch.msgid.link/20240624174601.1527244-3-sean.anderson@linux.dev
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/hwmon/iio_hwmon.c