init_data is a pointer. Use NULL instead of 0.
Silences the following sparse warning:
drivers/regulator/isl6271a-regulator.c:133:44:
warning: Using plain integer as NULL pointer
Signed-off-by: Sachin Kamat <[email protected]>
Cc: Marek Vasut <[email protected]>
---
drivers/regulator/isl6271a-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/isl6271a-regulator.c b/drivers/regulator/isl6271a-regulator.c
index d1e5bee..b99c49b 100644
--- a/drivers/regulator/isl6271a-regulator.c
+++ b/drivers/regulator/isl6271a-regulator.c
@@ -130,7 +130,7 @@ static int isl6271a_probe(struct i2c_client *i2c,
if (i == 0)
config.init_data = init_data;
else
- config.init_data = 0;
+ config.init_data = NULL;
config.driver_data = pmic;
pmic->rdev[i] = regulator_register(&isl_rd[i], &config);
--
1.7.9.5
Since 'id' cannot take two values at the same time, the condition
should probably be an OR (||) instead of AND (&&).
Introduced by commit 28d1e8cd67 ("regulator: palma: add ramp delay
support through regulator constraints").
Signed-off-by: Sachin Kamat <[email protected]>
Cc: Laxman Dewangan <[email protected]>
---
Compile tested against for-next branch of regulator tree.
---
drivers/regulator/palmas-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c
index 92ceed0..ced7416 100644
--- a/drivers/regulator/palmas-regulator.c
+++ b/drivers/regulator/palmas-regulator.c
@@ -840,7 +840,7 @@ static int palmas_regulators_probe(struct platform_device *pdev)
break;
}
- if ((id == PALMAS_REG_SMPS6) && (id == PALMAS_REG_SMPS8))
+ if ((id == PALMAS_REG_SMPS6) || (id == PALMAS_REG_SMPS8))
ramp_delay_support = true;
if (ramp_delay_support) {
--
1.7.9.5
On Wed, May 08, 2013 at 04:09:05PM +0530, Sachin Kamat wrote:
> init_data is a pointer. Use NULL instead of 0.
>
> Silences the following sparse warning:
> drivers/regulator/isl6271a-regulator.c:133:44:
> warning: Using plain integer as NULL pointer
Applied, thanks.
On Wed, May 08, 2013 at 04:09:06PM +0530, Sachin Kamat wrote:
> Since 'id' cannot take two values at the same time, the condition
> should probably be an OR (||) instead of AND (&&).
>
> Introduced by commit 28d1e8cd67 ("regulator: palma: add ramp delay
> support through regulator constraints").
Applied, thanks.