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

macintosh/ams: Fix unused variable warning

If both CONFIG_SENSORS_AMS_PMU and CONFIG_SENSORS_AMS_I2C are unset,
there is an unused variable warning in the ams driver:

drivers/macintosh/ams/ams-core.c: In function 'ams_init':
drivers/macintosh/ams/ams-core.c:181:29: warning: unused variable 'np'
181 | struct device_node *np;

The driver needs at least one of the configs enabled in order to
actually function. So fix the compiler warning by ensuring at least one
of the configs is enabled.

Suggested-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240507140150.54630-1-mpe@ellerman.id.au

+1 -1
+1 -1
drivers/macintosh/Kconfig
··· 262 262 will be called ams. 263 263 264 264 config SENSORS_AMS_PMU 265 - bool "PMU variant" 265 + bool "PMU variant" if SENSORS_AMS_I2C 266 266 depends on SENSORS_AMS && ADB_PMU 267 267 default y 268 268 help