2009-12-23 01:45:45

by Jeremy Kerr

[permalink] [raw]
Subject: [PATCH 0/3] Build fixes for test-devicetree

Hi all,

A small series of patches to fix minor build breakages when compiling
gcl's test-devicetree tree on ARM.

I've CC-ed lkml & linuxppc-dev for the fs/proc/ changes, but these
patches are only applicable to gcl's tree at present.

Cheers,


Jeremy

---
Jeremy Kerr (3):
of: include linux/proc_fs.h
of: make set_node_proc_entry private to proc_devtree.c
proc_devtree: include linux/of.h


2009-12-23 01:46:00

by Jeremy Kerr

[permalink] [raw]
Subject: [PATCH 2/3] of: make set_node_proc_entry private to proc_devtree.c

We only need set_node_proc_entry in proc_devtree.c, so move it there.

This fixes the !HAVE_ARCH_DEVTREE_FIXUPS build, as we can't make make
the definition in linux/of.h conditional on this #define (definitions in
asm/prom.h can't be exposed to linux/of.h, due to the enforced #include
ordering).

Signed-off-by: Jeremy Kerr <[email protected]>

---
fs/proc/proc_devtree.c | 5 +++--
include/linux/of.h | 6 ------
2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index 7ba79a5..31fc7e0 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -13,12 +13,13 @@
#include <asm/uaccess.h>
#include "internal.h"

-#ifndef HAVE_ARCH_DEVTREE_FIXUPS
static inline void set_node_proc_entry(struct device_node *np,
struct proc_dir_entry *de)
{
-}
+#ifdef HAVE_ARCH_DEVTREE_FIXUPS
+ np->pde = de;
#endif
+}

static struct proc_dir_entry *proc_device_tree;

diff --git a/include/linux/of.h b/include/linux/of.h
index 67c9206..9078747 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -75,12 +75,6 @@ static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
set_bit(flag, &n->_flags);
}

-static inline void
-set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
-{
- dn->pde = de;
-}
-
extern struct device_node *of_find_all_nodes(struct device_node *prev);

#if defined(CONFIG_SPARC)

2009-12-23 01:45:56

by Jeremy Kerr

[permalink] [raw]
Subject: [PATCH 1/3] of: include linux/proc_fs.h

We use a few procfs-specific functions (eg, proc_device_tree_*) which
aren't covered by the current includes. This causes the following build
error on arm:

drivers/of/base.c: In function 'prom_add_property':
drivers/of/base.c:861: error: implicit declaration of function 'proc_device_tree_add_prop'
drivers/of/base.c: In function 'prom_remove_property':
drivers/of/base.c:902: error: implicit declaration of function 'proc_device_tree_remove_prop'
drivers/of/base.c: In function 'prom_update_property':
drivers/of/base.c:946: error: implicit declaration of function 'proc_device_tree_update_prop'

Add proc_fs.h for these prototypes.

Signed-off-by: Jeremy Kerr <[email protected]>

---
drivers/of/base.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 974f64e..2dcb7a3 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/spinlock.h>
+#include <linux/proc_fs.h>

struct device_node *allnodes;

2009-12-23 01:46:23

by Jeremy Kerr

[permalink] [raw]
Subject: [PATCH 3/3] proc_devtree: include linux/of.h

Currenly, proc_devtree.c depends on asm/prom.h to include linux/of.h, to
provide some device-tree definitions (eg, struct property).

Instead, include linux/of.h directly. We still need asm/prom.h for
HAVE_ARCH_DEVTREE_FIXUPS.

Signed-off-by: Jeremy Kerr <[email protected]>

---
fs/proc/proc_devtree.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index 31fc7e0..2ea10dd 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -9,6 +9,7 @@
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/string.h>
+#include <linux/of.h>
#include <asm/prom.h>
#include <asm/uaccess.h>
#include "internal.h"

2009-12-23 14:48:45

by Grant Likely

[permalink] [raw]
Subject: Re: [PATCH 2/3] of: make set_node_proc_entry private to proc_devtree.c

On Tue, Dec 22, 2009 at 6:45 PM, Jeremy Kerr <[email protected]> wrote:
> We only need set_node_proc_entry in proc_devtree.c, so move it there.
>
> This fixes the !HAVE_ARCH_DEVTREE_FIXUPS build, as we can't make make
> the definition in linux/of.h conditional on this #define (definitions in
> asm/prom.h can't be exposed to linux/of.h, due to the enforced #include
> ordering).
>
> Signed-off-by: Jeremy Kerr <[email protected]>

A little ugly, but it can probably be refactored and cleaned up later
(like a lot of other things in the merged code). Otherwise these
three patches look good to me. I've picked them up into my tree and
I'll push them out soon.

g.

--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.