Thread (11 messages) 11 messages, 4 authors, 2025-11-05
STALE213d

[PATCH 1/2] powerpc/powermac: Include linux/of.h in backlight.c

From: Nathan Chancellor <nathan@kernel.org>
Date: 2025-09-25 23:46:23
Also in: linux-patches
Subsystem: linux for power macintosh, linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

After the recent removal of the fb.h include from backlight.h, which
transitively included of.h, there are several errors in the powermac backlight
driver:

  arch/powerpc/platforms/powermac/backlight.c: In function 'pmac_has_backlight_type':
  arch/powerpc/platforms/powermac/backlight.c:59:39: error: implicit declaration of function 'of_find_node_by_name'; did you mean 'bus_find_device_by_name'? [-Wimplicit-function-declaration]
     59 |         struct device_node* bk_node = of_find_node_by_name(NULL, "backlight");
        |                                       ^~~~~~~~~~~~~~~~~~~~
        |                                       bus_find_device_by_name
  arch/powerpc/platforms/powermac/backlight.c:59:39: error: initialization of 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  arch/powerpc/platforms/powermac/backlight.c:60:17: error: implicit declaration of function 'of_property_match_string' [-Wimplicit-function-declaration]
     60 |         int i = of_property_match_string(bk_node, "backlight-control", type);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~
  arch/powerpc/platforms/powermac/backlight.c:62:9: error: implicit declaration of function 'of_node_put' [-Wimplicit-function-declaration]
     62 |         of_node_put(bk_node);
        |         ^~~~~~~~~~~

Explicitly include of.h to resolve the errors.

Fixes: 9f218f9bb9d2 ("backlight: Do not include <linux/fb.h> in header file")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/powerpc/platforms/powermac/backlight.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c
index 79741370c40c..9afb64723649 100644
--- a/arch/powerpc/platforms/powermac/backlight.c
+++ b/arch/powerpc/platforms/powermac/backlight.c
@@ -14,6 +14,7 @@
 #include <linux/pmu.h>
 #include <linux/atomic.h>
 #include <linux/export.h>
+#include <linux/of.h>
 #include <asm/backlight.h>
 
 #define OLD_BACKLIGHT_MAX 15
-- 
2.51.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help