All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kristoffer Glembo <kristoffer@gaisler.com>
To: David Miller <davem@davemloft.net>
Cc: sfr@canb.auug.org.au, linux-next@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: linux-next: sparc tree build failure
Date: Fri, 13 Nov 2009 11:34:44 +0100	[thread overview]
Message-ID: <4AFD3644.1080907@gaisler.com> (raw)
In-Reply-To: <20091105.000012.61292273.davem@davemloft.net>

I noticed just now that this patch broke the driver on LEON SPARC. It
does not find the root node by using of_find_node_by_name(NULL, "/").

I'm not sure whether this is because we build our OF tree wrong or if
it is an incorrect way of doing things. But if I instead change it to
of_find_node_by_path("/") it works fine.

Signed-off-by: Kristoffer Glembo <kristoffer@gaisler.com>

---
  drivers/serial/apbuart.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/apbuart.c b/drivers/serial/apbuart.c
index a1e9503..fe91319 100644
--- a/drivers/serial/apbuart.c
+++ b/drivers/serial/apbuart.c
@@ -609,7 +609,7 @@ static void grlib_apbuart_configure(void)
                 return;

         /* Get bus frequency */
-       rp = of_find_node_by_name(NULL, "/");
+       rp = of_find_node_by_path("/");
         rp = of_get_next_child(rp, NULL);
         prop = of_get_property(rp, "clock-frequency", NULL);
         freq_khz = *prop;
--
1.5.2.2


David Miller wrote:
> 
> Hmm, it took a tiny bit more than that :-)  Here's what I commited
> to fix this, thanks.
> 
> apbuart: Kill dependency on deprecated Sparc-only PROM interfaces.
> 
> Use the proper modern OF ones instead.
> 
> Noticed by Stephen Rothwell.
> 
> Signed-off-by: David S. Miller <davem@davemloft.net>
> ---
>  drivers/serial/apbuart.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/serial/apbuart.c b/drivers/serial/apbuart.c
> index c7883a3..5f9dec3 100644
> --- a/drivers/serial/apbuart.c
> +++ b/drivers/serial/apbuart.c
> @@ -29,7 +29,6 @@
>  #include <linux/io.h>
>  #include <linux/serial_core.h>
>  #include <asm/irq.h>
> -#include <asm/oplib.h>
>  
>  #include "apbuart.h"
>  
> @@ -596,10 +595,9 @@ static struct of_platform_driver grlib_apbuart_of_driver = {
>  static void grlib_apbuart_configure(void)
>  {
>  	static int enum_done;
> -	struct device_node *np;
> +	struct device_node *np, *rp;
>  	struct uart_port *port = NULL;
> -
> -	int node;
> +	const u32 *prop;
>  	int freq_khz;
>  	int v = 0, d = 0;
>  	unsigned int addr;
> @@ -610,8 +608,10 @@ static void grlib_apbuart_configure(void)
>  		return;
>  
>  	/* Get bus frequency */
> -	node = prom_getchild(prom_root_node);
> -	freq_khz = prom_getint(node, "clock-frequency");
> +	rp = of_find_node_by_name(NULL, "/");
> +	rp = of_get_next_child(rp, NULL);
> +	prop = of_get_property(rp, "clock-frequency", NULL);
> +	freq_khz = *prop;
>  
>  	line = 0;
>  	for_each_matching_node(np, apbuart_match) {

  parent reply	other threads:[~2009-11-13 10:34 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-05  7:50 linux-next: sparc tree build failure Stephen Rothwell
2009-11-05  7:53 ` David Miller
2009-11-05  8:00   ` David Miller
2009-11-05 14:44     ` Kristoffer Glembo
2009-11-13 10:34     ` Kristoffer Glembo [this message]
2009-11-13 14:57       ` David Miller
2009-11-13 15:15         ` [PATCH] Use of_find_node_by_path to find root node Kristoffer Glembo
2009-11-13 21:25           ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2009-11-26  9:16 linux-next: sparc tree build failure Stephen Rothwell
2009-11-26 23:28 ` David Miller
2009-11-27  9:00   ` Thomas Gleixner
2009-11-06  7:02 Stephen Rothwell
2009-11-06  8:19 ` David Miller
2009-11-06  8:26   ` David Miller
2009-11-06  8:27     ` David Miller
2009-11-07  2:35     ` Stephen Rothwell
2009-10-05  7:43 Stephen Rothwell
2009-10-05  7:45 ` David Miller
2009-04-09  5:17 Stephen Rothwell
2009-04-09  5:27 ` Ingo Molnar
2009-04-09  5:28   ` David Miller
2009-04-09  5:36     ` Ingo Molnar
2009-04-09  5:40       ` David Miller
2009-04-09  5:53         ` Ingo Molnar
2009-04-09  5:59           ` David Miller
2009-04-09  5:28 ` David Miller
2009-04-14  3:45 ` Stephen Rothwell
2008-12-04  8:54 Stephen Rothwell
2008-12-04 11:47 ` Sam Ravnborg
2008-12-02  6:24 Stephen Rothwell
2008-12-02 11:22 ` Rusty Russell
2008-12-04  0:04   ` David Miller
2008-11-30 23:46 Stephen Rothwell
2008-12-01  5:41 ` Sam Ravnborg
2008-12-01  7:23   ` David Miller
2008-07-28  6:38 Stephen Rothwell
2008-07-28  8:21 ` Sam Ravnborg
2008-07-28  9:31   ` Adrian Bunk
2008-07-28 15:12     ` Stephen Rothwell
2008-07-28 10:12   ` Stephen Rothwell
2008-07-28 11:16     ` Sam Ravnborg
2008-07-25  7:05 Stephen Rothwell
2008-07-25  7:09 ` Stephen Rothwell
2008-07-26  9:25 ` David Miller
2008-08-04  4:26 ` David Miller
2008-08-04  5:35   ` Stephen Rothwell
2008-07-22  7:41 Stephen Rothwell
2008-07-22 22:47 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AFD3644.1080907@gaisler.com \
    --to=kristoffer@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.