diff mbox series

drm/drm_panel: fix EXPORT of drm_panel_of_backlight

Message ID 20191210194758.24087-1-sam@ravnborg.org (mailing list archive)
State New, archived
Headers show
Series drm/drm_panel: fix EXPORT of drm_panel_of_backlight | expand

Commit Message

Sam Ravnborg Dec. 10, 2019, 7:47 p.m. UTC
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 <sam@ravnborg.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
---
 drivers/gpu/drm/drm_panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Linus Walleij Dec. 10, 2019, 9:29 p.m. UTC | #1
On Tue, Dec 10, 2019 at 8:48 PM Sam Ravnborg <sam@ravnborg.org> wrote:

> 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 <sam@ravnborg.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> Cc: Sean Paul <sean@poorly.run>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Looks like the right fix to me:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Sam Ravnborg Dec. 11, 2019, 12:23 a.m. UTC | #2
Hi Linus.

On Tue, Dec 10, 2019 at 10:29:59PM +0100, Linus Walleij wrote:
> On Tue, Dec 10, 2019 at 8:48 PM Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > 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 <sam@ravnborg.org>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: Thierry Reding <thierry.reding@gmail.com>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > Cc: Sean Paul <sean@poorly.run>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > Cc: Maxime Ripard <mripard@kernel.org>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> 
> Looks like the right fix to me:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

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

	Sam
David Hildenbrand Dec. 16, 2019, 6:03 p.m. UTC | #3
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 )
Sam Ravnborg Dec. 18, 2019, 9:26 a.m. UTC | #4
Hi David.

On Mon, Dec 16, 2019 at 07:03:17PM +0100, David Hildenbrand wrote:
> 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 )
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
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index 03395ad4d907..79ff3fdf6f6e 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -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