Messages in this thread Patch in this message | | | From | Sebastian Reichel <> | Subject | [PATCH 3/3] power: bq27xxx_battery: fix defined but not used warnings | Date | Fri, 16 Oct 2015 15:44:12 +0200 |
| |
If BQ27XXX is enabled, but neither I2C based initialization, nor platform based initialization are activated, bq27xxx_powersupply_init and bq27xxx_powersupply_unregister are defined but not used.
This configuration doesn't make sense, but there is no easy way to make it unavailable in the build system, so just mark the functions as __maybe_unused instead.
Signed-off-by: Sebastian Reichel <sre@kernel.org> --- drivers/power/bq27xxx_battery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c index 880233ce9343..452c9f079e0d 100644 --- a/drivers/power/bq27xxx_battery.c +++ b/drivers/power/bq27xxx_battery.c @@ -991,7 +991,7 @@ static void bq27xxx_external_power_changed(struct power_supply *psy) schedule_delayed_work(&di->work, 0); } -static int bq27xxx_powersupply_init(struct bq27xxx_device_info *di, +static int __maybe_unused bq27xxx_powersupply_init(struct bq27xxx_device_info *di, const char *name) { int ret; @@ -1026,7 +1026,7 @@ static int bq27xxx_powersupply_init(struct bq27xxx_device_info *di, return 0; } -static void bq27xxx_powersupply_unregister(struct bq27xxx_device_info *di) +static void __maybe_unused bq27xxx_powersupply_unregister(struct bq27xxx_device_info *di) { /* * power_supply_unregister call bq27xxx_battery_get_property which -- 2.6.1
| |