From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/5] regulator: Use gpio_is_valid
Date: Mon, 6 Oct 2014 22:17:14 +0200 [thread overview]
Message-ID: <1412626635-7404-5-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1412626635-7404-1-git-send-email-mpa@pengutronix.de>
Use gpio_is_valid instead of custom check.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
drivers/regulator/fixed.c | 2 +-
drivers/regulator/gpio-regulator.c | 2 +-
drivers/regulator/wm8994-regulator.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 731f4315292c..35b00a288667 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -157,7 +157,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev)
drvdata->desc.fixed_uV = config->microvolts;
- if (config->gpio >= 0) {
+ if (gpio_is_valid(config->gpio)) {
cfg.ena_gpio = config->gpio;
cfg.ena_gpio_valid = true;
}
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c
index 681c604d4917..52d50aa9ab4b 100644
--- a/drivers/regulator/gpio-regulator.c
+++ b/drivers/regulator/gpio-regulator.c
@@ -322,7 +322,7 @@ static int gpio_regulator_probe(struct platform_device *pdev)
cfg.driver_data = drvdata;
cfg.of_node = np;
- if (config->enable_gpio >= 0) {
+ if (gpio_is_valid(config->enable_gpio)) {
cfg.ena_gpio = config->enable_gpio;
cfg.ena_gpio_valid = true;
}
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c
index dc7e80ab984e..8f2df50225a9 100644
--- a/drivers/regulator/wm8994-regulator.c
+++ b/drivers/regulator/wm8994-regulator.c
@@ -158,7 +158,7 @@ static int wm8994_ldo_probe(struct platform_device *pdev)
ldo->init_data = wm8994_ldo_default[id];
ldo->init_data.consumer_supplies = &ldo->supply;
- if (!config.ena_gpio)
+ if (!gpio_is_valid(config.ena_gpio))
ldo->init_data.constraints.valid_ops_mask = 0;
} else {
ldo->init_data = *pdata->ldo[id].init_data;
--
2.1.0
next prev parent reply other threads:[~2014-10-06 20:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 20:17 [PATCH 0/5] regulator: Fix core behaviour for gpio 0 Markus Pargmann
2014-10-06 20:17 ` [PATCH 1/5] regulator: Add ena_gpio_valid config Markus Pargmann
2014-10-07 11:53 ` Mark Brown
2014-10-07 13:03 ` Markus Pargmann
2014-10-07 16:19 ` Mark Brown
2014-10-07 19:18 ` Markus Pargmann
2014-10-06 20:17 ` [PATCH 2/5] regulator: Set ena_gpio_valid in regulator drivers Markus Pargmann
2014-10-07 8:46 ` Krzysztof Kozłowski
2014-10-07 9:10 ` Markus Pargmann
2014-10-07 11:58 ` Mark Brown
2014-10-07 13:05 ` Markus Pargmann
2014-10-06 20:17 ` [PATCH 3/5] regulator: Fix ena_gpio check Markus Pargmann
2014-10-06 20:17 ` Markus Pargmann [this message]
2014-10-07 12:01 ` [PATCH 4/5] regulator: Use gpio_is_valid Mark Brown
2014-10-07 13:07 ` Markus Pargmann
2014-10-07 16:20 ` Mark Brown
2014-10-06 20:17 ` [PATCH 5/5] regulator: Remove unnecessary ena_gpio initializations Markus Pargmann
2014-10-07 8:52 ` Krzysztof Kozłowski
2014-10-07 9:14 ` Markus Pargmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1412626635-7404-5-git-send-email-mpa@pengutronix.de \
--to=mpa@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).