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

power: rt9455: hide unused rt9455_boost_voltage_values

The rt9455_boost_voltage_values[] array is only used when USB PHY
support is enabled, causing a W=1 warning otherwise:

drivers/power/supply/rt9455_charger.c:200:18: error: 'rt9455_boost_voltage_values' defined but not used [-Werror=unused-const-variable=]

Enclose the definition in the same #ifdef as the references to it.

Fixes: e86d69dd786e ("power_supply: Add support for Richtek RT9455 battery charger")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240403080702.3509288-10-arnd@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Arnd Bergmann and committed by
Sebastian Reichel
452d8950 4cece764

+2
+2
drivers/power/supply/rt9455_charger.c
··· 192 192 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000, 4450000 193 193 }; 194 194 195 + #if IS_ENABLED(CONFIG_USB_PHY) 195 196 /* 196 197 * When the charger is in boost mode, REG02[7:2] represent boost output 197 198 * voltage. ··· 208 207 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 209 208 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 5600000, 210 209 }; 210 + #endif 211 211 212 212 /* REG07[3:0] (VMREG) in uV */ 213 213 static const int rt9455_vmreg_values[] = {