[PATCH] ARM: PRIMA2: rstc: use of_property_read_u32 to replace of_get_property and be32_to_cpup

Subsystems: arm port, the rest

STALE5084d

4 messages, 3 authors, 2012-09-11 · open the first message on its own page

[PATCH] ARM: PRIMA2: rstc: use of_property_read_u32 to replace of_get_property and be32_to_cpup

From: Barry Song <hidden>
Date: 2012-08-23 06:09:52

From: Barry Song <redacted>

Signed-off-by: Barry Song <redacted>
---
 arch/arm/mach-prima2/rstc.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index 762adb7..d03ff19 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -42,13 +42,10 @@ early_initcall(sirfsoc_of_rstc_init);
 
 int sirfsoc_reset_device(struct device *dev)
 {
-	const unsigned int *prop = of_get_property(dev->of_node, "reset-bit", NULL);
-	unsigned int reset_bit;
+	u32 reset_bit;
 
-	if (!prop)
-		return -ENODEV;
-
-	reset_bit = be32_to_cpup(prop);
+	if (of_property_read_u32(dev->of_node, "reset-bit", &reset_bit))
+		return -EINVAL;
 
 	mutex_lock(&rstc_lock);
 
-- 
1.7.0.4



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog

[PATCH] ARM: PRIMA2: rstc: use of_property_read_u32 to replace of_get_property and be32_to_cpup

From: Barry Song <hidden>
Date: 2012-09-05 08:58:25

2012/8/23 Barry Song [off-list ref]:
From: Barry Song <redacted>

Signed-off-by: Barry Song <redacted>
Olof, would you apply this or you want me to send a pull request for it?
quoted hunk
---
 arch/arm/mach-prima2/rstc.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index 762adb7..d03ff19 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -42,13 +42,10 @@ early_initcall(sirfsoc_of_rstc_init);

 int sirfsoc_reset_device(struct device *dev)
 {
-       const unsigned int *prop = of_get_property(dev->of_node, "reset-bit", NULL);
-       unsigned int reset_bit;
+       u32 reset_bit;

-       if (!prop)
-               return -ENODEV;
-
-       reset_bit = be32_to_cpup(prop);
+       if (of_property_read_u32(dev->of_node, "reset-bit", &reset_bit))
+               return -EINVAL;

        mutex_lock(&rstc_lock);

--
1.7.0.4
-barry

[PATCH] ARM: PRIMA2: rstc: use of_property_read_u32 to replace of_get_property and be32_to_cpup

From: Olof Johansson <hidden>
Date: 2012-09-07 22:23:33

On Wed, Sep 05, 2012 at 04:58:25PM +0800, Barry Song wrote:
2012/8/23 Barry Song [off-list ref]:
quoted
From: Barry Song <redacted>

Signed-off-by: Barry Song <redacted>
Olof, would you apply this or you want me to send a pull request for it?
I can apply it but it needs a patch description, at least a short sentence.


-Olof
quoted
---
 arch/arm/mach-prima2/rstc.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c
index 762adb7..d03ff19 100644
--- a/arch/arm/mach-prima2/rstc.c
+++ b/arch/arm/mach-prima2/rstc.c
@@ -42,13 +42,10 @@ early_initcall(sirfsoc_of_rstc_init);

 int sirfsoc_reset_device(struct device *dev)
 {
-       const unsigned int *prop = of_get_property(dev->of_node, "reset-bit", NULL);
-       unsigned int reset_bit;
+       u32 reset_bit;

-       if (!prop)
-               return -ENODEV;
-
-       reset_bit = be32_to_cpup(prop);
+       if (of_property_read_u32(dev->of_node, "reset-bit", &reset_bit))
+               return -EINVAL;

        mutex_lock(&rstc_lock);

--
1.7.0.4
-barry

[PATCH] ARM: PRIMA2: rstc: use of_property_read_u32 to replace of_get_property and be32_to_cpup

From: Barry Song <hidden>
Date: 2012-09-11 02:17:01

2012/9/8 Olof Johansson [off-list ref]:
On Wed, Sep 05, 2012 at 04:58:25PM +0800, Barry Song wrote:
quoted
2012/8/23 Barry Song [off-list ref]:
quoted
From: Barry Song <redacted>

Signed-off-by: Barry Song <redacted>
Olof, would you apply this or you want me to send a pull request for it?
I can apply it but it needs a patch description, at least a short sentence.
Thanks and done:
http://www.spinics.net/lists/arm-kernel/msg194041.html

-Olof
quoted
-barry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help