linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Build fixes for test-devicetree
@ 2009-12-23  1:45 Jeremy Kerr
  2009-12-23  1:45 ` [PATCH 3/3] proc_devtree: include linux/of.h Jeremy Kerr
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jeremy Kerr @ 2009-12-23  1:45 UTC (permalink / raw)
  To: Grant Likely, devicetree-discuss; +Cc: linuxppc-dev, linux-kernel

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

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

* [PATCH 1/3] of: include linux/proc_fs.h
  2009-12-23  1:45 [PATCH 0/3] Build fixes for test-devicetree Jeremy Kerr
  2009-12-23  1:45 ` [PATCH 3/3] proc_devtree: include linux/of.h Jeremy Kerr
  2009-12-23  1:45 ` [PATCH 2/3] of: make set_node_proc_entry private to proc_devtree.c Jeremy Kerr
@ 2009-12-23  1:45 ` Jeremy Kerr
  2 siblings, 0 replies; 5+ messages in thread
From: Jeremy Kerr @ 2009-12-23  1:45 UTC (permalink / raw)
  To: Grant Likely, devicetree-discuss; +Cc: linuxppc-dev, linux-kernel

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 <jeremy.kerr@canonical.com>

---
 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;
 

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

* [PATCH 2/3] of: make set_node_proc_entry private to proc_devtree.c
  2009-12-23  1:45 [PATCH 0/3] Build fixes for test-devicetree Jeremy Kerr
  2009-12-23  1:45 ` [PATCH 3/3] proc_devtree: include linux/of.h Jeremy Kerr
@ 2009-12-23  1:45 ` Jeremy Kerr
  2009-12-23 14:48   ` Grant Likely
  2009-12-23  1:45 ` [PATCH 1/3] of: include linux/proc_fs.h Jeremy Kerr
  2 siblings, 1 reply; 5+ messages in thread
From: Jeremy Kerr @ 2009-12-23  1:45 UTC (permalink / raw)
  To: Grant Likely, devicetree-discuss; +Cc: linuxppc-dev, linux-kernel

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 <jeremy.kerr@canonical.com>

---
 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)

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

* [PATCH 3/3] proc_devtree: include linux/of.h
  2009-12-23  1:45 [PATCH 0/3] Build fixes for test-devicetree Jeremy Kerr
@ 2009-12-23  1:45 ` Jeremy Kerr
  2009-12-23  1:45 ` [PATCH 2/3] of: make set_node_proc_entry private to proc_devtree.c Jeremy Kerr
  2009-12-23  1:45 ` [PATCH 1/3] of: include linux/proc_fs.h Jeremy Kerr
  2 siblings, 0 replies; 5+ messages in thread
From: Jeremy Kerr @ 2009-12-23  1:45 UTC (permalink / raw)
  To: Grant Likely, devicetree-discuss; +Cc: linuxppc-dev, linux-kernel

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 <jeremy.kerr@canonical.com>

---
 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"

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

* Re: [PATCH 2/3] of: make set_node_proc_entry private to proc_devtree.c
  2009-12-23  1:45 ` [PATCH 2/3] of: make set_node_proc_entry private to proc_devtree.c Jeremy Kerr
@ 2009-12-23 14:48   ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2009-12-23 14:48 UTC (permalink / raw)
  To: Jeremy Kerr; +Cc: devicetree-discuss, linuxppc-dev, linux-kernel

On Tue, Dec 22, 2009 at 6:45 PM, Jeremy Kerr <jeremy.kerr@canonical.com> 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 <jeremy.kerr@canonical.com>

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.

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

end of thread, other threads:[~2009-12-23 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-23  1:45 [PATCH 0/3] Build fixes for test-devicetree Jeremy Kerr
2009-12-23  1:45 ` [PATCH 3/3] proc_devtree: include linux/of.h Jeremy Kerr
2009-12-23  1:45 ` [PATCH 2/3] of: make set_node_proc_entry private to proc_devtree.c Jeremy Kerr
2009-12-23 14:48   ` Grant Likely
2009-12-23  1:45 ` [PATCH 1/3] of: include linux/proc_fs.h Jeremy Kerr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).