[PATCH 3/3] power: bq27xxx_battery: fix defined but not used warnings
From: Sebastian Reichel
Date: Fri Oct 16 2015 - 09:55:26 EST
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@xxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/