Hi Dave,
Today's linux-next build (powerpc allyesconfig) failed like this:
drivers/serial/apbuart.c:32:23: error: asm/oplib.h: No such file or directory
drivers/serial/apbuart.c:586: error: variable 'grlib_apbuart_of_driver' has initializer but incomplete type
drivers/serial/apbuart.c:587: error: unknown field 'match_table' specified in initializer
drivers/serial/apbuart.c:587: warning: excess elements in struct initializer
drivers/serial/apbuart.c:587: warning: (near initialization for 'grlib_apbuart_of_driver')
drivers/serial/apbuart.c:588: error: unknown field 'probe' specified in initializer
drivers/serial/apbuart.c:588: warning: excess elements in struct initializer
drivers/serial/apbuart.c:588: warning: (near initialization for 'grlib_apbuart_of_driver')
drivers/serial/apbuart.c:589: error: unknown field 'driver' specified in initializer
drivers/serial/apbuart.c:589: error: extra brace group at end of initializer
drivers/serial/apbuart.c:589: error: (near initialization for 'grlib_apbuart_of_driver')
drivers/serial/apbuart.c:592: warning: excess elements in struct initializer
drivers/serial/apbuart.c:592: warning: (near initialization for 'grlib_apbuart_of_driver')
drivers/serial/apbuart.c: In function 'grlib_apbuart_configure':
drivers/serial/apbuart.c:613: error: implicit declaration of function 'prom_getchild'
drivers/serial/apbuart.c:613: error: 'prom_root_node' undeclared (first use in this function)
drivers/serial/apbuart.c:613: error: (Each undeclared identifier is reported only once
drivers/serial/apbuart.c:613: error: for each function it appears in.)
drivers/serial/apbuart.c:614: error: implicit declaration of function 'prom_getint'
drivers/serial/apbuart.c: In function 'grlib_apbuart_init':
drivers/serial/apbuart.c:679: error: implicit declaration of function 'of_register_driver'
drivers/serial/apbuart.c:679: error: 'of_platform_bus_type' undeclared (first use in this function)
Caused by commit d4ac42a582e46d7f86f0acb4253a310423c72c4c ("sparc:
Support for GRLIB APBUART serial port"). I added the following patch for
today.
From: Stephen Rothwell <[email protected]>
Date: Thu, 5 Nov 2009 18:40:55 +1100
Subject: [PATCH] sparc: the GRLIB APBUART serial port will only build on sparc
Signed-off-by: Stephen Rothwell <[email protected]>
---
drivers/serial/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 50943ff..7ec806d 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -1480,6 +1480,7 @@ config SERIAL_BCM63XX_CONSOLE
config SERIAL_GRLIB_GAISLER_APBUART
tristate "GRLIB APBUART serial support"
depends on OF
+ depends on SPARC
---help---
Add support for the GRLIB APBUART serial port.
--
1.6.5.2
--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/
From: Stephen Rothwell <[email protected]>
Date: Thu, 5 Nov 2009 18:50:14 +1100
> Caused by commit d4ac42a582e46d7f86f0acb4253a310423c72c4c ("sparc:
> Support for GRLIB APBUART serial port"). I added the following patch for
> today.
Thanks, the real fix is to simply remove that include, it isn't
actually needed and the CONFIG_OF dependency is sufficient.
From: David Miller <[email protected]>
Date: Wed, 04 Nov 2009 23:53:15 -0800 (PST)
> From: Stephen Rothwell <[email protected]>
> Date: Thu, 5 Nov 2009 18:50:14 +1100
>
>> Caused by commit d4ac42a582e46d7f86f0acb4253a310423c72c4c ("sparc:
>> Support for GRLIB APBUART serial port"). I added the following patch for
>> today.
>
> Thanks, the real fix is to simply remove that include, it isn't
> actually needed and the CONFIG_OF dependency is sufficient.
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 <[email protected]>
---
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) {
--
1.6.5.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 <[email protected]>
Thanks guys. Sorry for the obsolete code :-)
Best regards,
Kristoffer
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 <[email protected]>
---
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 <[email protected]>
> ---
> 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) {
Your patch is correct but is whitespace damaged by your email
client.
Please take extra care to avoid this, because I spent the time to
prepare your patch for application and then it failed, and therefore I
wasted my time on your patch.