lkml.org 
[lkml]   [2024]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ACPI: fan: Add hwmon support
Hi,

On 2024-04-08 14:37:18+0200, Armin Wolf wrote:
> Currently, the driver does only supports a custom sysfs
> interface to allow userspace to read the fan speed.
> Add support for the standard hwmon interface so users
> can read the fan speed with standard tools like "sensors".
>
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
> ---
> drivers/acpi/Makefile | 1 +
> drivers/acpi/fan.h | 2 ++
> drivers/acpi/fan_core.c | 7 ++++
> drivers/acpi/fan_hwmon.c | 78 ++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 88 insertions(+)
> create mode 100644 drivers/acpi/fan_hwmon.c

[snip]

> +
> +int devm_acpi_fan_create_hwmon(struct acpi_device *device)
> +{
> + struct device *hdev;
> +
> + hdev = devm_hwmon_device_register_with_info(&device->dev, "acpi_fan", device,
> + &acpi_fan_chip_info, NULL);

This fails to link if CONFIG_ACPI_FAN=y and CONFIG_HWMON=n:

ld: vmlinux.o: in function `devm_acpi_fan_create_hwmon':
../drivers/acpi/fan_hwmon.c:74:(.text+0x819e65): undefined reference to `devm_hwmon_device_register_with_info'

With this fixed:

Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>

> +
> + return PTR_ERR_OR_ZERO(hdev);
> +}
> --
> 2.39.2
>
>

\
 
 \ /
  Last update: 2024-05-27 16:28    [W:0.105 / U:1.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site