devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: fixed: use of_property_read_{bool|u32}()
@ 2014-05-25 19:50 Sergei Shtylyov
       [not found] ` <201405252350.40402.sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Sergei Shtylyov @ 2014-05-25 19:50 UTC (permalink / raw)
  To: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w, broonie-DgEjT+Ai2ygdnm+yROfE0A
  Cc: grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, devicetree-u79uwXL29TY76Z2rM5mHXA

Use more compact of_property_read_{bool|u32}() calls instead of the
of_{find|get}_property() calls.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>

---
The patch is against Mark Brown's 'regulator.git' repo's 'for-next' branch.

 drivers/regulator/fixed.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

Index: regulator/drivers/regulator/fixed.c
===================================================================
--- regulator.orig/drivers/regulator/fixed.c
+++ regulator/drivers/regulator/fixed.c
@@ -50,7 +50,6 @@ of_get_fixed_voltage_config(struct devic
 {
 	struct fixed_voltage_config *config;
 	struct device_node *np = dev->of_node;
-	const __be32 *delay;
 	struct regulator_init_data *init_data;
 
 	config = devm_kzalloc(dev, sizeof(struct fixed_voltage_config),
@@ -91,15 +90,11 @@ of_get_fixed_voltage_config(struct devic
 	if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER))
 		return ERR_PTR(-EPROBE_DEFER);
 
-	delay = of_get_property(np, "startup-delay-us", NULL);
-	if (delay)
-		config->startup_delay = be32_to_cpu(*delay);
+	of_property_read_u32(np, "startup-delay-us", &config->startup_delay);
 
-	if (of_find_property(np, "enable-active-high", NULL))
-		config->enable_high = true;
-
-	if (of_find_property(np, "gpio-open-drain", NULL))
-		config->gpio_is_open_drain = true;
+	config->enable_high = of_property_read_bool(np, "enable-active-high");
+	config->gpio_is_open_drain = of_property_read_bool(np,
+							   "gpio-open-drain");
 
 	if (of_find_property(np, "vin-supply", NULL))
 		config->input_supply = "vin";
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] regulator: fixed: use of_property_read_{bool|u32}()
       [not found] ` <201405252350.40402.sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
@ 2014-05-26 15:19   ` Mark Brown
       [not found]     ` <20140526151958.GU22111-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2014-05-26 15:19 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, devicetree-u79uwXL29TY76Z2rM5mHXA

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

On Sun, May 25, 2014 at 11:50:39PM +0400, Sergei Shtylyov wrote:
> Use more compact of_property_read_{bool|u32}() calls instead of the
> of_{find|get}_property() calls.

Applied, thanks.  Always CC mailing lists on patches.

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

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

* Re: [PATCH] regulator: fixed: use of_property_read_{bool|u32}()
       [not found]     ` <20140526151958.GU22111-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2014-05-26 17:33       ` Sergei Shtylyov
       [not found]         ` <53837AEE.7030400-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Sergei Shtylyov @ 2014-05-26 17:33 UTC (permalink / raw)
  To: Mark Brown
  Cc: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, devicetree-u79uwXL29TY76Z2rM5mHXA

Hello.

On 05/26/2014 07:19 PM, Mark Brown wrote:

>> Use more compact of_property_read_{bool|u32}() calls instead of the
>> of_{find|get}_property() calls.

> Applied, thanks.

    Thank you for the quick reply! :-)

>  Always CC mailing lists on patches.

    Er, I did CC devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org but (as usual) avoided CCing LKML 
-- that's all the lists scripts/get_maintainer.pl suggested. Do you mean some 
other list I don't know about?

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] regulator: fixed: use of_property_read_{bool|u32}()
       [not found]         ` <53837AEE.7030400-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
@ 2014-05-26 17:56           ` Mark Brown
       [not found]             ` <20140526175648.GG12304-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2014-05-26 17:56 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, devicetree-u79uwXL29TY76Z2rM5mHXA

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

On Mon, May 26, 2014 at 09:33:34PM +0400, Sergei Shtylyov wrote:
> On 05/26/2014 07:19 PM, Mark Brown wrote:

> > Always CC mailing lists on patches.

>    Er, I did CC devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org but (as usual) avoided CCing LKML
> -- that's all the lists scripts/get_maintainer.pl suggested. Do you mean
> some other list I don't know about?

By avoiding CCing lkml you avoided CCing the list where regulator
patches are discussed.  When using get_maintainers.pl you need to think
about what it's telling you.

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

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

* Re: [PATCH] regulator: fixed: use of_property_read_{bool|u32}()
       [not found]             ` <20140526175648.GG12304-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2014-05-26 18:01               ` Sergei Shtylyov
       [not found]                 ` <53838184.9070401-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Sergei Shtylyov @ 2014-05-26 18:01 UTC (permalink / raw)
  To: Mark Brown
  Cc: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, devicetree-u79uwXL29TY76Z2rM5mHXA

On 05/26/2014 09:56 PM, Mark Brown wrote:

>>> Always CC mailing lists on patches.

>>     Er, I did CC devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org but (as usual) avoided CCing LKML
>> -- that's all the lists scripts/get_maintainer.pl suggested. Do you mean
>> some other list I don't know about?

> By avoiding CCing lkml you avoided CCing the list where regulator
> patches are discussed.  When using get_maintainers.pl you need to think
> about what it's telling you.

    The problem with LKML is that it's always suggested, even for the very 
minor patches that should not be of interest to the wide public. I'll keep in 
mind that the regulator patches are discussed on LKML.

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] regulator: fixed: use of_property_read_{bool|u32}()
       [not found]                 ` <53838184.9070401-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
@ 2014-05-26 18:07                   ` Fabio Estevam
       [not found]                     ` <CAOMZO5Dg-rU5qFSYJEK9h1PwuN6Y099LVjHWOqSwV0Ro6PxFTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2014-05-26 18:12                   ` Mark Brown
  1 sibling, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2014-05-26 18:07 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: Mark Brown, Liam Girdwood, Grant Likely,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Mon, May 26, 2014 at 3:01 PM, Sergei Shtylyov
<sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org> wrote:

>> By avoiding CCing lkml you avoided CCing the list where regulator
>> patches are discussed.  When using get_maintainers.pl you need to think
>> about what it's telling you.
>
>
>    The problem with LKML is that it's always suggested, even for the very
> minor patches that should not be of interest to the wide public. I'll keep
> in mind that the regulator patches are discussed on LKML.

Maybe a linux-regulator list would be helpful?
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] regulator: fixed: use of_property_read_{bool|u32}()
       [not found]                 ` <53838184.9070401-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
  2014-05-26 18:07                   ` Fabio Estevam
@ 2014-05-26 18:12                   ` Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-05-26 18:12 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: lgirdwood-Re5JQEeQqe8AvxtiuMwx3w,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, devicetree-u79uwXL29TY76Z2rM5mHXA

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

On Mon, May 26, 2014 at 10:01:40PM +0400, Sergei Shtylyov wrote:
> On 05/26/2014 09:56 PM, Mark Brown wrote:

> >By avoiding CCing lkml you avoided CCing the list where regulator
> >patches are discussed.  When using get_maintainers.pl you need to think
> >about what it's telling you.

>    The problem with LKML is that it's always suggested, even for the very
> minor patches that should not be of interest to the wide public. I'll keep
> in mind that the regulator patches are discussed on LKML.

This is why you need to think about what get_maintainer.pl is telling
you - it'll give you some suggestions, you need to understand why they
are there and do something sensible with them.  For example if there's
no subsystem specific list then you need to include lkml.

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

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

* Re: [PATCH] regulator: fixed: use of_property_read_{bool|u32}()
       [not found]                     ` <CAOMZO5Dg-rU5qFSYJEK9h1PwuN6Y099LVjHWOqSwV0Ro6PxFTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2014-06-01 12:50                       ` Mark Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2014-06-01 12:50 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Sergei Shtylyov, Liam Girdwood, Grant Likely,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

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

On Mon, May 26, 2014 at 03:07:01PM -0300, Fabio Estevam wrote:
> On Mon, May 26, 2014 at 3:01 PM, Sergei Shtylyov

> >    The problem with LKML is that it's always suggested, even for the very
> > minor patches that should not be of interest to the wide public. I'll keep
> > in mind that the regulator patches are discussed on LKML.

> Maybe a linux-regulator list would be helpful?

We really don't have enough traffic for it to be useful I think - it's
not like regulator is unique in this regard, there's plenty of other
subsystems don't have a dedicated list.  The only thing it might help
with is patchwork which is too limited to pick things off of the main
kernel list in any useful fashion.

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

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

end of thread, other threads:[~2014-06-01 12:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-25 19:50 [PATCH] regulator: fixed: use of_property_read_{bool|u32}() Sergei Shtylyov
     [not found] ` <201405252350.40402.sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2014-05-26 15:19   ` Mark Brown
     [not found]     ` <20140526151958.GU22111-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-05-26 17:33       ` Sergei Shtylyov
     [not found]         ` <53837AEE.7030400-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2014-05-26 17:56           ` Mark Brown
     [not found]             ` <20140526175648.GG12304-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-05-26 18:01               ` Sergei Shtylyov
     [not found]                 ` <53838184.9070401-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
2014-05-26 18:07                   ` Fabio Estevam
     [not found]                     ` <CAOMZO5Dg-rU5qFSYJEK9h1PwuN6Y099LVjHWOqSwV0Ro6PxFTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-01 12:50                       ` Mark Brown
2014-05-26 18:12                   ` 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).