Skip to contentSkip to conversation

common: reset_source: Remove of_get_reset_source_priority()

PATCH In review Alexander Shiyan 3 participants 7 messages Jun 8, 2022 – Jun 10, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common: reset_source: Remove of_get_reset_source_priority()

of_get_reset_source_priority() has no users,
so it can be safely removed.

---
 common/reset_source.c  | 20 +++-----------------
 include/reset_source.h |  7 -------
 2 files changed, 3 insertions(+), 24 deletions(-)
common/reset_source.c +3 -17
index 3554cbd0fb..dccb683231 100644
@@ -76,7 +76,9 @@ EXPORT_SYMBOL(reset_source_set_prinst);
 
 void reset_source_set_device(struct device_d *dev, enum reset_src_type st)
 {
-	int priority = of_get_reset_source_priority(dev->device_node);
+	unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;
+
+	of_property_read_u32(node, "reset-source-priority", &priority);
 
 	__reset_source_set(dev, st, priority, -1);
 }
@@ -92,19 +94,3 @@ static int reset_source_init(void)
 	return 0;
 }
 coredevice_initcall(reset_source_init);
-
-/**
- * of_get_reset_source_priority() - get the desired reset source priority from
- *                                  device tree
- * @node:	The device_node to read the property from
- *
- * return: The priority
- */
-unsigned int of_get_reset_source_priority(struct device_node *node)
-{
-	unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;
-
-	of_property_read_u32(node, "reset-source-priority", &priority);
-
-	return priority;
-}
include/reset_source.h +0 -7
index 023b1fe4a0..a98c61ae0e 100644
@@ -32,8 +32,6 @@ void reset_source_set_device(struct device_d *dev, enum reset_src_type st);
 void reset_source_set_prinst(enum reset_src_type,
 			     unsigned int priority, int instance);
 
-unsigned int of_get_reset_source_priority(struct device_node *node);
-
 #else
 
 static inline enum reset_src_type reset_source_get(void)
@@ -69,11 +67,6 @@ static inline void reset_source_set_prinst(enum reset_src_type type,
 static inline void reset_source_set_instance(enum reset_src_type type, int instance)
 {
 }
-
-static inline unsigned int of_get_reset_source_priority(struct device_node *node)
-{
-	return 0;
-}
 #endif
 
 #define RESET_SOURCE_DEFAULT_PRIORITY 100
Signature · 7 lines
2.32.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 14 lines · Alexander Shiyan

of_get_reset_source_priority() has no users,
so it can be safely removed.

---
 common/reset_source.c  | 20 +++-----------------
 include/reset_source.h |  7 -------
 2 files changed, 3 insertions(+), 24 deletions(-)
common/reset_source.c +0 -0
index 3554cbd0fb..dccb683231 100644

common/reset_source.c EXPORT_SYMBOL(reset_source_set_prinst); · line 79

Quoted 5 lines
common/reset_source.c +1 -1
@@ -76,7 +76,9 @@ EXPORT_SYMBOL(reset_source_set_prinst);
 
 void reset_source_set_device(struct device_d *dev, enum reset_src_type st)
 {
-	int priority = of_get_reset_source_priority(dev->device_node);
+	unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;

You said of_get_reset_source_priority() has no users, but here you are removing one.

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

чт, 9 июн. 2022 г. в 10:32, Sascha Hauer <[email protected]>:

Quoted 16 lines · Alexander Shiyan
Quoted 15 lines

of_get_reset_source_priority() has no users,
so it can be safely removed.

---
 common/reset_source.c  | 20 +++-----------------
 include/reset_source.h |  7 -------
 2 files changed, 3 insertions(+), 24 deletions(-)
common/reset_source.c +0 -0
index 3554cbd0fb..dccb683231 100644
@@ -76,7 +76,9 @@ EXPORT_SYMBOL(reset_source_set_prinst);
 
Quoted 7 lines

common/reset_source.c EXPORT_SYMBOL(reset_source_set_prinst); · line 79

Quoted 4 lines
common/reset_source.c +1 -1
 void reset_source_set_device(struct device_d *dev, enum reset_src_type st)
 {
-     int priority = of_get_reset_source_priority(dev->device_node);
+     unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;

You said of_get_reset_source_priority() has no users, but here you are removing one.

Hello.

Here I meant users outside of the unit :)

Should I create v2?

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#3 lore raw
Quoted 25 lines · Alexander Shiyan

чт, 9 июн. 2022 г. в 10:32, Sascha Hauer <[email protected]>:

Quoted 16 lines · Alexander Shiyan
Quoted 15 lines

of_get_reset_source_priority() has no users,
so it can be safely removed.

---
 common/reset_source.c  | 20 +++-----------------
 include/reset_source.h |  7 -------
 2 files changed, 3 insertions(+), 24 deletions(-)
common/reset_source.c +0 -0
index 3554cbd0fb..dccb683231 100644
@@ -76,7 +76,9 @@ EXPORT_SYMBOL(reset_source_set_prinst);
 
Quoted 7 lines

common/reset_source.c EXPORT_SYMBOL(reset_source_set_prinst); · line 79

Quoted 4 lines
common/reset_source.c +1 -1
 void reset_source_set_device(struct device_d *dev, enum reset_src_type st)
 {
-     int priority = of_get_reset_source_priority(dev->device_node);
+     unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;

You said of_get_reset_source_priority() has no users, but here you are removing one.

Quoted 3 lines

Hello.

Here I meant users outside of the unit :)

Oh, I misread the patch. I thought that it removes the

	of_property_read_u32(node, "reset-source-priority", &priority);

That's not the case, you just placed the line inline.

Ok then, applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#4 lore raw
In reply to Alexander Shiyan

Hi Alexander,

Quoted 14 lines · Alexander Shiyan

of_get_reset_source_priority() has no users,
so it can be safely removed.

---
 common/reset_source.c  | 20 +++-----------------
 include/reset_source.h |  7 -------
 2 files changed, 3 insertions(+), 24 deletions(-)
common/reset_source.c +0 -0
index 3554cbd0fb..dccb683231 100644

common/reset_source.c EXPORT_SYMBOL(reset_source_set_prinst); · line 81

Quoted 7 lines
common/reset_source.c +3 -1
@@ -76,7 +76,9 @@ EXPORT_SYMBOL(reset_source_set_prinst);
 
 void reset_source_set_device(struct device_d *dev, enum reset_src_type st)
 {
-	int priority = of_get_reset_source_priority(dev->device_node);
+	unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;
+
+	of_property_read_u32(node, "reset-source-priority", &priority);

This seems to break my build:
barebox/common/reset_source.c:81:30: error: 'node' undeclared (first use in this function)
81 | of_property_read_u32(node, "reset-source-priority",
&priority);
| ^~~~

Should "node" be replaced by "dev->device_node"?

Best regards,
Michael

Quoted 38 lines
common/reset_source.c +0 -16
 	__reset_source_set(dev, st, priority, -1);
 }
@@ -92,19 +94,3 @@ static int reset_source_init(void)
 	return 0;
 }
 coredevice_initcall(reset_source_init);
-
-/**
- * of_get_reset_source_priority() - get the desired reset source priority from
- *                                  device tree
- * @node:	The device_node to read the property from
- *
- * return: The priority
- */
-unsigned int of_get_reset_source_priority(struct device_node *node)
-{
-	unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;
-
-	of_property_read_u32(node, "reset-source-priority", &priority);
-
-	return priority;
-}
include/reset_source.h +0 -2
index 023b1fe4a0..a98c61ae0e 100644
@@ -32,8 +32,6 @@ void reset_source_set_device(struct device_d *dev, enum reset_src_type st);
 void reset_source_set_prinst(enum reset_src_type,
 			     unsigned int priority, int instance);
 
-unsigned int of_get_reset_source_priority(struct device_node *node);
-
 #else
 
 static inline enum reset_src_type reset_source_get(void)
@@ -69,11 +67,6 @@ static inline void reset_source_set_prinst(enum reset_src_type type,
 static inline void reset_source_set_instance(enum reset_src_type type, int instance)

include/reset_source.h static inline void reset_source_set_prinst(enum reset_src_type type, · line 72

Quoted 10 lines
include/reset_source.h +0 -5
 {
 }
-
-static inline unsigned int of_get_reset_source_priority(struct device_node *node)
-{
-	return 0;
-}
 #endif
 
 #define RESET_SOURCE_DEFAULT_PRIORITY 100

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#5 lore raw

чт, 9 июн. 2022 г. в 23:08, Michael Riesch <[email protected]>:

Quoted 32 lines

Hi Alexander,

Quoted 14 lines · Alexander Shiyan

of_get_reset_source_priority() has no users,
so it can be safely removed.

---
 common/reset_source.c  | 20 +++-----------------
 include/reset_source.h |  7 -------
 2 files changed, 3 insertions(+), 24 deletions(-)
common/reset_source.c +0 -0
index 3554cbd0fb..dccb683231 100644

common/reset_source.c EXPORT_SYMBOL(reset_source_set_prinst); · line 81

Quoted 7 lines
common/reset_source.c +3 -1
@@ -76,7 +76,9 @@ EXPORT_SYMBOL(reset_source_set_prinst);
 
 void reset_source_set_device(struct device_d *dev, enum reset_src_type st)
 {
-     int priority = of_get_reset_source_priority(dev->device_node);
+     unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;
+
+     of_property_read_u32(node, "reset-source-priority", &priority);

This seems to break my build:
barebox/common/reset_source.c:81:30: error: 'node' undeclared (first use in this function)
81 | of_property_read_u32(node, "reset-source-priority",
&priority);
| ^~~~

Quoted 1 line

Should "node" be replaced by "dev->device_node"?

Hello.

You're right.
Unfortunately, I do not yet see this patch in the next branch to create a fixup.

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#6 lore raw
Quoted 33 lines · Alexander Shiyan

чт, 9 июн. 2022 г. в 23:08, Michael Riesch <[email protected]>:

Quoted 32 lines

Hi Alexander,

Quoted 14 lines · Alexander Shiyan

of_get_reset_source_priority() has no users,
so it can be safely removed.

---
 common/reset_source.c  | 20 +++-----------------
 include/reset_source.h |  7 -------
 2 files changed, 3 insertions(+), 24 deletions(-)
common/reset_source.c +0 -0
index 3554cbd0fb..dccb683231 100644

common/reset_source.c EXPORT_SYMBOL(reset_source_set_prinst); · line 81

Quoted 7 lines
common/reset_source.c +3 -1
@@ -76,7 +76,9 @@ EXPORT_SYMBOL(reset_source_set_prinst);
 
 void reset_source_set_device(struct device_d *dev, enum reset_src_type st)
 {
-     int priority = of_get_reset_source_priority(dev->device_node);
+     unsigned int priority = RESET_SOURCE_DEFAULT_PRIORITY;
+
+     of_property_read_u32(node, "reset-source-priority", &priority);

This seems to break my build:
barebox/common/reset_source.c:81:30: error: 'node' undeclared (first use in this function)
81 | of_property_read_u32(node, "reset-source-priority",
&priority);
| ^~~~

Quoted 6 lines
Quoted 1 line

Should "node" be replaced by "dev->device_node"?

Hello.

You're right.
Unfortunately, I do not yet see this patch in the next branch to create a fixup.

I fixed it up. Check latest next branch

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox