diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2015-05-06 15:50:09 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-05-22 00:09:52 +0300 |
commit | eaacaa09e42ab9ae0ebc25fc2b72aef02e3f284a (patch) | |
tree | eada74a728ab46510758e20cab38afb0e7b1edef /drivers/regulator/max8973-regulator.c | |
parent | dcd9ec6ae3667d3bb92cbb9b59c7f4864316448d (diff) | |
download | linux-eaacaa09e42ab9ae0ebc25fc2b72aef02e3f284a.tar.xz |
regulator: max8973: make default/unset dvs gpio as invalid gpio
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>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/max8973-regulator.c')
-rw-r--r-- | drivers/regulator/max8973-regulator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c index be9a463d7354..3df5a84f819c 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; |