Skip to contentSkip to conversation

drm/drm_panel: fix EXPORT of drm_panel_of_backlight

PATCH In review Sam Ravnborg 3 participants 5 messages Dec 10, 2019 – Dec 18, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/drm_panel: fix EXPORT of drm_panel_of_backlight

Fix link failure for module builds of panels.
The conditional compilation around drm_panel_of_backlight() was wrong for a module build.
Fix it using IS_ENABLED().

Fixes 152dbdeab1b2 ("drm/panel: add backlight support")
Cc Sam Ravnborg <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maxime Ripard <[email protected]>
---
 drivers/gpu/drm/drm_panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_panel.c +1 -1
index 03395ad4d907..79ff3fdf6f6e 100644
@@ -302,7 +302,7 @@ struct drm_panel *of_drm_find_panel(const struct device_node *np)
 EXPORT_SYMBOL(of_drm_find_panel);
 #endif
 
-#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
+#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
 /**
  * drm_panel_of_backlight - use backlight device node for backlight
  * @panel: DRM panel
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Sam Ravnborg

Fix link failure for module builds of panels.
The conditional compilation around drm_panel_of_backlight() was wrong for a module build.
Fix it using IS_ENABLED().

Quoted 12 lines
Fixes 152dbdeab1b2 ("drm/panel: add backlight support")
Cc Sam Ravnborg <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maxime Ripard <[email protected]>

Looks like the right fix to me:

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Hi Linus.

Quoted 20 lines · Linus Walleij
Quoted 5 lines · Sam Ravnborg

Fix link failure for module builds of panels.
The conditional compilation around drm_panel_of_backlight() was wrong for a module build.
Fix it using IS_ENABLED().

Quoted 12 lines
Fixes 152dbdeab1b2 ("drm/panel: add backlight support")
Cc Sam Ravnborg <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Sean Paul <[email protected]>
Cc David Airlie <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Maxime Ripard <[email protected]>
Quoted 2 lines

Looks like the right fix to me:

Thanks, patch pushed to drm-misc-next so we have this fixed.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

powernv build issue

In reply to Sam Ravnborg

Hi,

the patch "drm/drm_panel: fix EXPORT of drm_panel_of_backlight" in linux-next breaks the powernv build:

desktop: ~/git/linux-ppc memtrace $ ./compile.sh

  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o

MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0x2fc8): Section mismatch in reference from the variable start_here_common to the function .init.text:start_kernel() The function start_here_common() references
the function __init start_kernel().
This is often because start_here_common lacks a __init annotation or the annotation of start_kernel is wrong.

MODINFO modules.builtin.modinfo
LD .tmp_vmlinux1
ppc64-linux-gnu-ld: drivers/gpu/drm/drm_panel.o: in function `drm_panel_of_backlight':
(.text+0x434): undefined reference to `devm_of_find_backlight'
make: *** [Makefile:1079: vmlinux] Fehler 1

Reverting it makes it compile again. (not exploring the root issue, I just need a powernv built and reverting that commit did the trick )

Signature · 8 lines
Thanks,

David / dhildenb

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: powernv build issue

Hi David.

Quoted 30 lines · David Hildenbrand

Hi,

the patch "drm/drm_panel: fix EXPORT of drm_panel_of_backlight" in linux-next breaks the powernv build:

desktop: ~/git/linux-ppc memtrace $ ./compile.sh

  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o

MODPOST vmlinux.o
WARNING: vmlinux.o(.text+0x2fc8): Section mismatch in reference from the variable start_here_common to the function .init.text:start_kernel() The function start_here_common() references
the function __init start_kernel().
This is often because start_here_common lacks a __init annotation or the annotation of start_kernel is wrong.

MODINFO modules.builtin.modinfo
LD .tmp_vmlinux1
ppc64-linux-gnu-ld: drivers/gpu/drm/drm_panel.o: in function `drm_panel_of_backlight':
(.text+0x434): undefined reference to `devm_of_find_backlight'
make: *** [Makefile:1079: vmlinux] Fehler 1

Quoted 2 lines

Reverting it makes it compile again. (not exploring the root issue, I just need a powernv built and reverting that commit did the trick )

Thanks for the report.

Andy already provided a fix that is now applied to drm-misc-next - and should show up in -next within a day.
Sorry for the troubles!

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel