mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] common: reset_source: Remove of_get_reset_source_priority()
@ 2022-06-08  5:12 Alexander Shiyan
  2022-06-09  7:32 ` Sascha Hauer
  2022-06-09 20:07 ` Michael Riesch
  0 siblings, 2 replies; 7+ messages in thread
From: Alexander Shiyan @ 2022-06-08  5:12 UTC (permalink / raw)
  To: barebox; +Cc: Alexander Shiyan

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

Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
 common/reset_source.c  | 20 +++-----------------
 include/reset_source.h |  7 -------
 2 files changed, 3 insertions(+), 24 deletions(-)

diff --git a/common/reset_source.c b/common/reset_source.c
index 3554cbd0fb..dccb683231 100644
--- a/common/reset_source.c
+++ b/common/reset_source.c
@@ -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;
-}
diff --git a/include/reset_source.h b/include/reset_source.h
index 023b1fe4a0..a98c61ae0e 100644
--- a/include/reset_source.h
+++ b/include/reset_source.h
@@ -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
-- 
2.32.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] common: reset_source: Remove of_get_reset_source_priority()
  2022-06-08  5:12 [PATCH] common: reset_source: Remove of_get_reset_source_priority() Alexander Shiyan
@ 2022-06-09  7:32 ` Sascha Hauer
  2022-06-09  7:38   ` Alexander Shiyan
  2022-06-09 20:07 ` Michael Riesch
  1 sibling, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2022-06-09  7:32 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Wed, Jun 08, 2022 at 08:12:44AM +0300, Alexander Shiyan wrote:
> of_get_reset_source_priority() has no users,
> so it can be safely removed.
> 
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> ---
>  common/reset_source.c  | 20 +++-----------------
>  include/reset_source.h |  7 -------
>  2 files changed, 3 insertions(+), 24 deletions(-)
> 
> diff --git a/common/reset_source.c b/common/reset_source.c
> index 3554cbd0fb..dccb683231 100644
> --- a/common/reset_source.c
> +++ b/common/reset_source.c
> @@ -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

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] common: reset_source: Remove of_get_reset_source_priority()
  2022-06-09  7:32 ` Sascha Hauer
@ 2022-06-09  7:38   ` Alexander Shiyan
  2022-06-09  8:40     ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Shiyan @ 2022-06-09  7:38 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: Barebox List

чт, 9 июн. 2022 г. в 10:32, Sascha Hauer <sha@pengutronix.de>:
> On Wed, Jun 08, 2022 at 08:12:44AM +0300, Alexander Shiyan wrote:
> > of_get_reset_source_priority() has no users,
> > so it can be safely removed.
> >
> > Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> > ---
> >  common/reset_source.c  | 20 +++-----------------
> >  include/reset_source.h |  7 -------
> >  2 files changed, 3 insertions(+), 24 deletions(-)
> >
> > diff --git a/common/reset_source.c b/common/reset_source.c
> > index 3554cbd0fb..dccb683231 100644
> > --- a/common/reset_source.c
> > +++ b/common/reset_source.c
> > @@ -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.

Hello.

Here I meant users outside of the unit :)

Should I create v2?

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] common: reset_source: Remove of_get_reset_source_priority()
  2022-06-09  7:38   ` Alexander Shiyan
@ 2022-06-09  8:40     ` Sascha Hauer
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2022-06-09  8:40 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: Barebox List

On Thu, Jun 09, 2022 at 10:38:55AM +0300, Alexander Shiyan wrote:
> чт, 9 июн. 2022 г. в 10:32, Sascha Hauer <sha@pengutronix.de>:
> > On Wed, Jun 08, 2022 at 08:12:44AM +0300, Alexander Shiyan wrote:
> > > of_get_reset_source_priority() has no users,
> > > so it can be safely removed.
> > >
> > > Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> > > ---
> > >  common/reset_source.c  | 20 +++-----------------
> > >  include/reset_source.h |  7 -------
> > >  2 files changed, 3 insertions(+), 24 deletions(-)
> > >
> > > diff --git a/common/reset_source.c b/common/reset_source.c
> > > index 3554cbd0fb..dccb683231 100644
> > > --- a/common/reset_source.c
> > > +++ b/common/reset_source.c
> > > @@ -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.
> 
> 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

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] common: reset_source: Remove of_get_reset_source_priority()
  2022-06-08  5:12 [PATCH] common: reset_source: Remove of_get_reset_source_priority() Alexander Shiyan
  2022-06-09  7:32 ` Sascha Hauer
@ 2022-06-09 20:07 ` Michael Riesch
  2022-06-10  5:07   ` Alexander Shiyan
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Riesch @ 2022-06-09 20:07 UTC (permalink / raw)
  To: barebox

Hi Alexander,

On 6/8/22 07:12, Alexander Shiyan wrote:
> of_get_reset_source_priority() has no users,
> so it can be safely removed.
> 
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> ---
>  common/reset_source.c  | 20 +++-----------------
>  include/reset_source.h |  7 -------
>  2 files changed, 3 insertions(+), 24 deletions(-)
> 
> diff --git a/common/reset_source.c b/common/reset_source.c
> index 3554cbd0fb..dccb683231 100644
> --- a/common/reset_source.c
> +++ b/common/reset_source.c
> @@ -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

>  
>  	__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;
> -}
> diff --git a/include/reset_source.h b/include/reset_source.h
> index 023b1fe4a0..a98c61ae0e 100644
> --- a/include/reset_source.h
> +++ b/include/reset_source.h
> @@ -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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

* Re: [PATCH] common: reset_source: Remove of_get_reset_source_priority()
  2022-06-09 20:07 ` Michael Riesch
@ 2022-06-10  5:07   ` Alexander Shiyan
  2022-06-10  7:32     ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Shiyan @ 2022-06-10  5:07 UTC (permalink / raw)
  To: Michael Riesch; +Cc: Barebox List

чт, 9 июн. 2022 г. в 23:08, Michael Riesch <michael.riesch@wolfvision.net>:
>
> Hi Alexander,
> On 6/8/22 07:12, Alexander Shiyan wrote:
> > of_get_reset_source_priority() has no users,
> > so it can be safely removed.
> >
> > Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> > ---
> >  common/reset_source.c  | 20 +++-----------------
> >  include/reset_source.h |  7 -------
> >  2 files changed, 3 insertions(+), 24 deletions(-)
> >
> > diff --git a/common/reset_source.c b/common/reset_source.c
> > index 3554cbd0fb..dccb683231 100644
> > --- a/common/reset_source.c
> > +++ b/common/reset_source.c
> > @@ -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"?

Hello.

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

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH] common: reset_source: Remove of_get_reset_source_priority()
  2022-06-10  5:07   ` Alexander Shiyan
@ 2022-06-10  7:32     ` Sascha Hauer
  0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2022-06-10  7:32 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: Michael Riesch, Barebox List

On Fri, Jun 10, 2022 at 08:07:58AM +0300, Alexander Shiyan wrote:
> чт, 9 июн. 2022 г. в 23:08, Michael Riesch <michael.riesch@wolfvision.net>:
> >
> > Hi Alexander,
> > On 6/8/22 07:12, Alexander Shiyan wrote:
> > > of_get_reset_source_priority() has no users,
> > > so it can be safely removed.
> > >
> > > Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> > > ---
> > >  common/reset_source.c  | 20 +++-----------------
> > >  include/reset_source.h |  7 -------
> > >  2 files changed, 3 insertions(+), 24 deletions(-)
> > >
> > > diff --git a/common/reset_source.c b/common/reset_source.c
> > > index 3554cbd0fb..dccb683231 100644
> > > --- a/common/reset_source.c
> > > +++ b/common/reset_source.c
> > > @@ -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"?
> 
> 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

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2022-06-10  7:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08  5:12 [PATCH] common: reset_source: Remove of_get_reset_source_priority() Alexander Shiyan
2022-06-09  7:32 ` Sascha Hauer
2022-06-09  7:38   ` Alexander Shiyan
2022-06-09  8:40     ` Sascha Hauer
2022-06-09 20:07 ` Michael Riesch
2022-06-10  5:07   ` Alexander Shiyan
2022-06-10  7:32     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox