Commit f52c4d5f authored by Ben Dooks's avatar Ben Dooks Committed by Sebastian Reichel

power: supply: bq27xxx: fix NULL vs 0 warnings

The driver has a lot of sparse warnings for using 0 as a NULL
pointer when NULL would be appropriate. Change the 0 values
to NULL to fix the warnings, some of which are shown here:

drivers/power/supply/bq27xxx_battery.c:984:23: warning: Using plain integer as NULL pointer
drivers/power/supply/bq27xxx_battery.c:985:23: warning: Using plain integer as NULL pointer
drivers/power/supply/bq27xxx_battery.c:986:23: warning: Using plain integer as NULL pointer
drivers/power/supply/bq27xxx_battery.c:987:23: warning: Using plain integer as NULL pointer
drivers/power/supply/bq27xxx_battery.c:988:23: warning: Using plain integer as NULL pointer
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 569581a2
......@@ -868,11 +868,11 @@ enum bq27xxx_dm_reg_id {
BQ27XXX_DM_TERMINATE_VOLTAGE,
};
#define bq27000_dm_regs 0
#define bq27010_dm_regs 0
#define bq2750x_dm_regs 0
#define bq2751x_dm_regs 0
#define bq2752x_dm_regs 0
#define bq27000_dm_regs NULL
#define bq27010_dm_regs NULL
#define bq2750x_dm_regs NULL
#define bq2751x_dm_regs NULL
#define bq2752x_dm_regs NULL
#if 0 /* not yet tested */
static struct bq27xxx_dm_reg bq27500_dm_regs[] = {
......@@ -881,24 +881,24 @@ static struct bq27xxx_dm_reg bq27500_dm_regs[] = {
[BQ27XXX_DM_TERMINATE_VOLTAGE] = { 80, 48, 2, 1000, 32767 },
};
#else
#define bq27500_dm_regs 0
#define bq27500_dm_regs NULL
#endif
/* todo create data memory definitions from datasheets and test on chips */
#define bq27510g1_dm_regs 0
#define bq27510g2_dm_regs 0
#define bq27510g3_dm_regs 0
#define bq27520g1_dm_regs 0
#define bq27520g2_dm_regs 0
#define bq27520g3_dm_regs 0
#define bq27520g4_dm_regs 0
#define bq27521_dm_regs 0
#define bq27530_dm_regs 0
#define bq27531_dm_regs 0
#define bq27541_dm_regs 0
#define bq27542_dm_regs 0
#define bq27546_dm_regs 0
#define bq27742_dm_regs 0
#define bq27510g1_dm_regs NULL
#define bq27510g2_dm_regs NULL
#define bq27510g3_dm_regs NULL
#define bq27520g1_dm_regs NULL
#define bq27520g2_dm_regs NULL
#define bq27520g3_dm_regs NULL
#define bq27520g4_dm_regs NULL
#define bq27521_dm_regs NULL
#define bq27530_dm_regs NULL
#define bq27531_dm_regs NULL
#define bq27541_dm_regs NULL
#define bq27542_dm_regs NULL
#define bq27546_dm_regs NULL
#define bq27742_dm_regs NULL
#if 0 /* not yet tested */
static struct bq27xxx_dm_reg bq27545_dm_regs[] = {
......@@ -907,7 +907,7 @@ static struct bq27xxx_dm_reg bq27545_dm_regs[] = {
[BQ27XXX_DM_TERMINATE_VOLTAGE] = { 80, 67, 2, 2800, 3700 },
};
#else
#define bq27545_dm_regs 0
#define bq27545_dm_regs NULL
#endif
static struct bq27xxx_dm_reg bq27411_dm_regs[] = {
......@@ -937,7 +937,7 @@ static struct bq27xxx_dm_reg bq27426_dm_regs[] = {
#if 0 /* not yet tested */
#define bq27441_dm_regs bq27421_dm_regs
#else
#define bq27441_dm_regs 0
#define bq27441_dm_regs NULL
#endif
#if 0 /* not yet tested */
......@@ -947,13 +947,13 @@ static struct bq27xxx_dm_reg bq27621_dm_regs[] = {
[BQ27XXX_DM_TERMINATE_VOLTAGE] = { 82, 9, 2, 2500, 3700 },
};
#else
#define bq27621_dm_regs 0
#define bq27621_dm_regs NULL
#endif
#define bq27z561_dm_regs 0
#define bq28z610_dm_regs 0
#define bq34z100_dm_regs 0
#define bq78z100_dm_regs 0
#define bq27z561_dm_regs NULL
#define bq28z610_dm_regs NULL
#define bq34z100_dm_regs NULL
#define bq78z100_dm_regs NULL
#define BQ27XXX_O_ZERO BIT(0)
#define BQ27XXX_O_OTDC BIT(1) /* has OTC/OTD overtemperature flags */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment