Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hwmon: (gpd-fan) Fix compilation error in non-ACPI builds

Building gpd-fan driver without CONFIG_ACPI results in the following
build errors:

drivers/hwmon/gpd-fan.c: In function ‘gpd_ecram_read’:
drivers/hwmon/gpd-fan.c:228:9: error: implicit declaration of function ‘outb’ [-Werror=implicit-function-declaration]
228 | outb(0x2E, addr_port);
| ^~~~
drivers/hwmon/gpd-fan.c:241:16: error: implicit declaration of function ‘inb’ [-Werror=implicit-function-declaration]
241 | *val = inb(data_port);

The definitions for inb() and outb() come from <linux/io.h>
(specifically through <asm/io.h>), which is implicitly included via
<acpi_io.h>. When CONFIG_ACPI is not set, <acpi_io.h> is not included
resulting in <linux/io.h> to be omitted as well.

Since the driver does not depend on ACPI, remove <linux/acpi.h> and add
<linux/io.h> directly to fix the compilation errors.

Signed-off-by: Gopi Krishna Menon <krishnagopi487@gmail.com>
Link: https://lore.kernel.org/r/20251024202042.752160-1-krishnagopi487@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Gopi Krishna Menon and committed by
Guenter Roeck
9efb297c e9a6fb0b

+1 -1
+1 -1
drivers/hwmon/gpd-fan.c
··· 12 12 * Copyright (c) 2024 Cryolitia PukNgae 13 13 */ 14 14 15 - #include <linux/acpi.h> 16 15 #include <linux/dmi.h> 17 16 #include <linux/hwmon.h> 17 + #include <linux/io.h> 18 18 #include <linux/ioport.h> 19 19 #include <linux/kernel.h> 20 20 #include <linux/module.h>