Skip to content

Commit 9efb297

Browse files
gopi487krishnagroeck
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent e9a6fb0 commit 9efb297

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/hwmon/gpd-fan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
* Copyright (c) 2024 Cryolitia PukNgae
1313
*/
1414

15-
#include <linux/acpi.h>
1615
#include <linux/dmi.h>
1716
#include <linux/hwmon.h>
17+
#include <linux/io.h>
1818
#include <linux/ioport.h>
1919
#include <linux/kernel.h>
2020
#include <linux/module.h>

0 commit comments

Comments
 (0)