* [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return
@ 2016-03-10 12:12 Laxman Dewangan
2016-03-10 12:12 ` [PATCH] regulator: of: Use of_property_read_u32() for reading min/max Laxman Dewangan
2016-03-11 4:30 ` [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return Mark Brown
0 siblings, 2 replies; 6+ messages in thread
From: Laxman Dewangan @ 2016-03-10 12:12 UTC (permalink / raw)
To: broonie, lgirdwood; +Cc: linux-kernel, Laxman Dewangan
The GPIO interface of_get_named_gpio() has implemented the proper
error returns even EPROBE_DEFER and hence caller need not to
implement any WAR for translating the returned error.
Remove the WAR implemented in fixed regulator to handle the
return of of_get_named_gpio().
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
As per comment, it is said that patch is already posted. If the patch is
active then please add my Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/regulator/fixed.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index ff62d69..988a747 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -79,18 +79,8 @@ of_get_fixed_voltage_config(struct device *dev,
config->enabled_at_boot = true;
config->gpio = of_get_named_gpio(np, "gpio", 0);
- /*
- * of_get_named_gpio() currently returns ENODEV rather than
- * EPROBE_DEFER. This code attempts to be compatible with both
- * for now; the ENODEV check can be removed once the API is fixed.
- * of_get_named_gpio() doesn't differentiate between a missing
- * property (which would be fine here, since the GPIO is optional)
- * and some other error. Patches have been posted for both issues.
- * Once they are check in, we should replace this with:
- * if (config->gpio < 0 && config->gpio != -ENOENT)
- */
- if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER))
- return ERR_PTR(-EPROBE_DEFER);
+ if ((config->gpio < 0) && (config->gpio != -ENOENT))
+ return ERR_PTR(config->gpio);
of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] regulator: of: Use of_property_read_u32() for reading min/max
2016-03-10 12:12 [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return Laxman Dewangan
@ 2016-03-10 12:12 ` Laxman Dewangan
2016-03-11 4:30 ` [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return Mark Brown
1 sibling, 0 replies; 6+ messages in thread
From: Laxman Dewangan @ 2016-03-10 12:12 UTC (permalink / raw)
To: broonie, lgirdwood; +Cc: linux-kernel, Laxman Dewangan
OF interface provides to read the u32 value via standard interface
of_property_read_u32(). Use this API to read "regulator-min-microvolts"
and "regulator-max-microvolt".
This will make consistent with other property value reads.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
drivers/regulator/of_regulator.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
index fe2e3344..6b0aa80 100644
--- a/drivers/regulator/of_regulator.c
+++ b/drivers/regulator/of_regulator.c
@@ -28,7 +28,6 @@ static void of_get_regulation_constraints(struct device_node *np,
struct regulator_init_data **init_data,
const struct regulator_desc *desc)
{
- const __be32 *min_uV, *max_uV;
struct regulation_constraints *constraints = &(*init_data)->constraints;
struct regulator_state *suspend_state;
struct device_node *suspend_np;
@@ -37,18 +36,18 @@ static void of_get_regulation_constraints(struct device_node *np,
constraints->name = of_get_property(np, "regulator-name", NULL);
- min_uV = of_get_property(np, "regulator-min-microvolt", NULL);
- if (min_uV)
- constraints->min_uV = be32_to_cpu(*min_uV);
- max_uV = of_get_property(np, "regulator-max-microvolt", NULL);
- if (max_uV)
- constraints->max_uV = be32_to_cpu(*max_uV);
+ if (!of_property_read_u32(np, "regulator-min-microvolt", &pval))
+ constraints->min_uV = pval;
+
+ if (!of_property_read_u32(np, "regulator-max-microvolt", &pval))
+ constraints->max_uV = pval;
/* Voltage change possible? */
if (constraints->min_uV != constraints->max_uV)
constraints->valid_ops_mask |= REGULATOR_CHANGE_VOLTAGE;
/* Only one voltage? Then make sure it's set. */
- if (min_uV && max_uV && constraints->min_uV == constraints->max_uV)
+ if (constraints->min_uV && constraints->max_uV &&
+ constraints->min_uV == constraints->max_uV)
constraints->apply_uV = true;
if (!of_property_read_u32(np, "regulator-microvolt-offset", &pval))
--
2.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return
2016-03-10 12:12 [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return Laxman Dewangan
2016-03-10 12:12 ` [PATCH] regulator: of: Use of_property_read_u32() for reading min/max Laxman Dewangan
@ 2016-03-11 4:30 ` Mark Brown
2016-03-11 8:14 ` Laxman Dewangan
1 sibling, 1 reply; 6+ messages in thread
From: Mark Brown @ 2016-03-11 4:30 UTC (permalink / raw)
To: Laxman Dewangan; +Cc: lgirdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 239 bytes --]
On Thu, Mar 10, 2016 at 05:42:46PM +0530, Laxman Dewangan wrote:
> Remove the WAR implemented in fixed regulator to handle the
> return of of_get_named_gpio().
You need to explain what a WAR is, I suspect it's some nVidia internal
term.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return
2016-03-11 4:30 ` [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return Mark Brown
@ 2016-03-11 8:14 ` Laxman Dewangan
2016-03-12 5:58 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Laxman Dewangan @ 2016-03-11 8:14 UTC (permalink / raw)
To: Mark Brown; +Cc: lgirdwood, linux-kernel
On Friday 11 March 2016 10:00 AM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Thu, Mar 10, 2016 at 05:42:46PM +0530, Laxman Dewangan wrote:
>
>> Remove the WAR implemented in fixed regulator to handle the
>> return of of_get_named_gpio().
> You need to explain what a WAR is, I suspect it's some nVidia internal
> term.
>
We used term "WAR" as workaround. This we used for special handling in
SW for unusual stuff.
Probably "Hack" is the more appropriate word.
Should I use "hack" here?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return
2016-03-11 8:14 ` Laxman Dewangan
@ 2016-03-12 5:58 ` Mark Brown
2016-03-13 12:55 ` Laxman Dewangan
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2016-03-12 5:58 UTC (permalink / raw)
To: Laxman Dewangan; +Cc: lgirdwood, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 622 bytes --]
On Fri, Mar 11, 2016 at 01:44:18PM +0530, Laxman Dewangan wrote:
> On Friday 11 March 2016 10:00 AM, Mark Brown wrote:
> >>Remove the WAR implemented in fixed regulator to handle the
> >>return of of_get_named_gpio().
> >You need to explain what a WAR is, I suspect it's some nVidia internal
> >term.
> We used term "WAR" as workaround. This we used for special handling in SW
> for unusual stuff.
> Probably "Hack" is the more appropriate word.
> Should I use "hack" here?
What is wrong with "workaround"? Or just generally write the commit
message so someone outside nVidia can tell what the commit message
means.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return
2016-03-12 5:58 ` Mark Brown
@ 2016-03-13 12:55 ` Laxman Dewangan
0 siblings, 0 replies; 6+ messages in thread
From: Laxman Dewangan @ 2016-03-13 12:55 UTC (permalink / raw)
To: Mark Brown; +Cc: lgirdwood, linux-kernel
On Saturday 12 March 2016 11:28 AM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Fri, Mar 11, 2016 at 01:44:18PM +0530, Laxman Dewangan wrote:
>> On Friday 11 March 2016 10:00 AM, Mark Brown wrote:
>>>> Remove the WAR implemented in fixed regulator to handle the
>>>> return of of_get_named_gpio().
>>> You need to explain what a WAR is, I suspect it's some nVidia internal
>>> term.
>> We used term "WAR" as workaround. This we used for special handling in SW
>> for unusual stuff.
>> Probably "Hack" is the more appropriate word.
>> Should I use "hack" here?
> What is wrong with "workaround"? Or just generally write the commit
> message so someone outside nVidia can tell what the commit message
> means.
OK, will send the patch with term "workaround".
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-03-13 13:08 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10 12:12 [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return Laxman Dewangan
2016-03-10 12:12 ` [PATCH] regulator: of: Use of_property_read_u32() for reading min/max Laxman Dewangan
2016-03-11 4:30 ` [PATCH] regulator: fixed: Remove WARs for handling of_get_named_gpio() return Mark Brown
2016-03-11 8:14 ` Laxman Dewangan
2016-03-12 5:58 ` Mark Brown
2016-03-13 12:55 ` Laxman Dewangan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox