Skip to contentSkip to conversation

hwmon: (xdpe12284) Fix build warning seen if CONFIG_SENSORS_XDPE122_REGULATOR is disabled

PATCH New Guenter Roeck 1 participant 1 message Mar 25, 2022 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 1/1 hwmon: (xdpe12284) Fix build warning seen if CONFIG_SENSORS_XDPE122_REGULATOR is disabled

0-day reports:

drivers/hwmon/pmbus/xdpe12284.c:127:36: warning:
unused variable 'xdpe122_reg_desc'

This is seen if CONFIG_SENSORS_XDPE122_REGULATOR is not enabled. Mark xdpe122_reg_desc as __maybe_unused to fix the problem.

Fixes f53bfe4d6984 ("hwmon: (xdpe12284) Add regulator support")
Cc Marcello Sylvester Bauer <[email protected]>
---
 drivers/hwmon/pmbus/xdpe12284.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/pmbus/xdpe12284.c +1 -1
index 18fffc5d749b..32bc7736d609 100644
@@ -124,7 +124,7 @@ static int xdpe122_identify(struct i2c_client *client,
 	return 0;
 }
 
-static const struct regulator_desc xdpe122_reg_desc[] = {
+static const struct regulator_desc __maybe_unused xdpe122_reg_desc[] = {
 	PMBUS_REGULATOR("vout", 0),
 	PMBUS_REGULATOR("vout", 1),
 };
Signature · 1 line
2.35.1