linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: isl6271a: Use NULL instead of 0
@ 2013-05-08 10:39 Sachin Kamat
  2013-05-08 10:39 ` [PATCH 2/2] regulator: palmas: Fix incorrect condition Sachin Kamat
  2013-05-08 12:41 ` [PATCH 1/2] regulator: isl6271a: Use NULL instead of 0 Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Sachin Kamat @ 2013-05-08 10:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, lgirdwood, sachin.kamat, Marek Vasut

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 <sachin.kamat@linaro.org>
Cc: Marek Vasut <marek.vasut@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] regulator: palmas: Fix incorrect condition
  2013-05-08 10:39 [PATCH 1/2] regulator: isl6271a: Use NULL instead of 0 Sachin Kamat
@ 2013-05-08 10:39 ` Sachin Kamat
  2013-05-10 11:11   ` Mark Brown
  2013-05-08 12:41 ` [PATCH 1/2] regulator: isl6271a: Use NULL instead of 0 Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Sachin Kamat @ 2013-05-08 10:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: broonie, lgirdwood, sachin.kamat, Laxman Dewangan

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 <sachin.kamat@linaro.org>
Cc: Laxman Dewangan <ldewangan@nvidia.com>
---
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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] regulator: isl6271a: Use NULL instead of 0
  2013-05-08 10:39 [PATCH 1/2] regulator: isl6271a: Use NULL instead of 0 Sachin Kamat
  2013-05-08 10:39 ` [PATCH 2/2] regulator: palmas: Fix incorrect condition Sachin Kamat
@ 2013-05-08 12:41 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-05-08 12:41 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, lgirdwood, Marek Vasut

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] regulator: palmas: Fix incorrect condition
  2013-05-08 10:39 ` [PATCH 2/2] regulator: palmas: Fix incorrect condition Sachin Kamat
@ 2013-05-10 11:11   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2013-05-10 11:11 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-kernel, lgirdwood, Laxman Dewangan

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

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.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-10 11:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-08 10:39 [PATCH 1/2] regulator: isl6271a: Use NULL instead of 0 Sachin Kamat
2013-05-08 10:39 ` [PATCH 2/2] regulator: palmas: Fix incorrect condition Sachin Kamat
2013-05-10 11:11   ` Mark Brown
2013-05-08 12:41 ` [PATCH 1/2] regulator: isl6271a: Use NULL instead of 0 Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).