of.h: Keep extern declaration of of_* variables when !CONFIG_OF

Fixes build failure in simplefb on architectures without CONFIG_OF.

svn path=/dists/sid/linux/; revision=22439
This commit is contained in:
Ben Hutchings 2015-03-01 15:13:10 +00:00
parent de4bc4d36f
commit c581056403
3 changed files with 42 additions and 0 deletions

2
debian/changelog vendored
View File

@ -191,6 +191,8 @@ linux (3.16.7-ckt7-1) UNRELEASED; urgency=medium
- qxl: Disable by default, as it is incompatible with wheezy's
xserver-xorg-video-qxl. It can be forced to load with module
parameter modeset=1.
* of.h: Keep extern declaration of of_* variables when !CONFIG_OF
(for simplefb)
[ Helge Deller ]
* [alpha] build debian-installer udeb packages

View File

@ -0,0 +1,39 @@
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 14 Nov 2014 13:26:52 +0100
Subject: of.h: Keep extern declaration of of_* variables when !CONFIG_OF
Origin: https://git.kernel.org/linus/6d09dc6b74caaca83e32e67f2454406041d58fb0
Keep the extern declaration of of_allnodes and friends, when building without
of support, this way code using them can be written like this:
if (IS_ENABLED(CONFIG_OF_PLATFORM) && of_chosen) {
for_each_child_of_node(of_chosen, np)
...
}
And rely on the compiler optimizing it away, avoiding the need for #ifdef-ery.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
include/linux/of.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -107,14 +107,13 @@ static inline struct device_node *of_nod
static inline void of_node_put(struct device_node *node) { }
#endif /* !CONFIG_OF_DYNAMIC */
-#ifdef CONFIG_OF
-
/* Pointer for first entry in chain of all nodes. */
extern struct device_node *of_allnodes;
extern struct device_node *of_chosen;
extern struct device_node *of_aliases;
extern raw_spinlock_t devtree_lock;
+#ifdef CONFIG_OF
static inline bool of_have_populated_dt(void)
{
return of_allnodes != NULL;

View File

@ -213,6 +213,7 @@ features/all/efi-expose-underlying-uefi-firmware-platform-size-to.patch
features/all/simplefb-formalize-pseudo-palette-handling.patch
features/all/simplefb-add-goto-error-path-to-probe.patch
features/all/simplefb-add-clock-handling-code.patch
features/all/of.h-keep-extern-declaration-of-of_-variables-when-c.patch
features/all/simplefb-Add-support-for-enumerating-simplefb-dt-nod.patch
features/all/simplefb-Change-simplefb_init-from-module_init-to-fs.patch
features/all/simplefb-Fix-build-errors-when-CONFIG_COMMON_CLK-is-.patch