mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RESEND PATCH 1/2] regulator: max8973: make default/unset dvs gpio as invalid gpio
@ 2015-05-06 12:50 Laxman Dewangan
  2015-05-06 12:50 ` [RESEND PATCH 2/2] regulator: max8973: get rid of extra variable for gpio validity Laxman Dewangan
  2015-05-21 21:10 ` [RESEND PATCH 1/2] regulator: max8973: make default/unset dvs gpio as invalid gpio Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Laxman Dewangan @ 2015-05-06 12:50 UTC (permalink / raw)
  To: broonie, lgirdwood; +Cc: linux-kernel, Laxman Dewangan

If platform data has dvs-gpio value 0 as default/unset then
make this as invalid gpio so that function gpio_is_valid()
can return false on this case.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
This patch is applied earlier but not able to apply on latest
so sending it again.

 drivers/regulator/max8973-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c
index be9a463..3df5a84 100644
--- a/drivers/regulator/max8973-regulator.c
+++ b/drivers/regulator/max8973-regulator.c
@@ -413,7 +413,7 @@ static int max8973_probe(struct i2c_client *client,
 	}
 
 	if (pdata) {
-		max->dvs_gpio = pdata->dvs_gpio;
+		max->dvs_gpio = (pdata->dvs_gpio) ? pdata->dvs_gpio : -EINVAL;
 		max->enable_external_control = pdata->enable_ext_control;
 		max->curr_gpio_val = pdata->dvs_def_state;
 		max->curr_vout_reg = MAX8973_VOUT + pdata->dvs_def_state;
-- 
2.1.4


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

end of thread, other threads:[~2015-05-21 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06 12:50 [RESEND PATCH 1/2] regulator: max8973: make default/unset dvs gpio as invalid gpio Laxman Dewangan
2015-05-06 12:50 ` [RESEND PATCH 2/2] regulator: max8973: get rid of extra variable for gpio validity Laxman Dewangan
2015-05-21 21:10   ` Mark Brown
2015-05-21 21:10 ` [RESEND PATCH 1/2] regulator: max8973: make default/unset dvs gpio as invalid gpio Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®