Skip to contentSkip to conversation

backlight: extend of_find_backlight_by_node stub-check to modules

PATCH In review Heiko Stübner 3 participants 3 messages Nov 4, 2014 Backlight class/subsystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backlight: extend of_find_backlight_by_node stub-check to modules

Commit de3d75dc2311 ("backlight: Use of_find_backlight_by_node stub when backlight class disabled") did not take into account that the backlight class can also be compiled as module. Extend the check to prevent redefinition warnings when the backlight device class is compiled as module.

Reported-by kbuild test robot
---
 include/linux/backlight.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/backlight.h +2 -1
index d9cb644..92b9817 100644
@@ -157,7 +157,8 @@ struct generic_bl_info {
 	void (*kick_battery)(void);
 };
 
-#if defined(CONFIG_OF) && defined(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if defined(CONFIG_OF) && (defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
+			   defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE))
 struct backlight_device *of_find_backlight_by_node(struct device_node *node);
 #else
 static inline struct backlight_device *
Signature · 1 line
2.0.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Heiko Stübner

Commit de3d75dc2311 ("backlight: Use of_find_backlight_by_node stub when backlight class disabled") did not take into account that the backlight class can also be compiled as module. Extend the check to prevent redefinition warnings when the backlight device class is compiled as module.

Reported-by kbuild test robot

If there is no objection, I hope that this patch is merged. Thank you.

Best regards,
Jingoo Han

Quoted 20 lines
---
 include/linux/backlight.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/backlight.h +2 -2
index d9cb644..92b9817 100644
@@ -157,7 +157,8 @@ struct generic_bl_info {
 	void (*kick_battery)(void);
 };
 
-#if defined(CONFIG_OF) && defined(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if defined(CONFIG_OF) && (defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
+			   defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE))
 struct backlight_device *of_find_backlight_by_node(struct device_node *node);
 #else
 static inline struct backlight_device *
--

2.0.1

#2 lore raw
In reply to Heiko Stübner
Quoted 10 lines · Heiko Stübner

Commit de3d75dc2311 ("backlight: Use of_find_backlight_by_node stub when backlight class disabled") did not take into account that the backlight class can also be compiled as module. Extend the check to prevent redefinition warnings when the backlight device class is compiled as module.

Reported-by kbuild test robot
---
 include/linux/backlight.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied with Jingoo's Ack.

Quoted 14 lines
include/linux/backlight.h +2 -1
index d9cb644..92b9817 100644
@@ -157,7 +157,8 @@ struct generic_bl_info {
 	void (*kick_battery)(void);
 };
 
-#if defined(CONFIG_OF) && defined(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if defined(CONFIG_OF) && (defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
+			   defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE))
 struct backlight_device *of_find_backlight_by_node(struct device_node *node);
 #else
 static inline struct backlight_device *
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog