All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: i915: fix build when ACPI is disabled and BACKLIGHT=m
@ 2021-04-26 18:35 ` Randy Dunlap
  0 siblings, 0 replies; 12+ messages in thread
From: Randy Dunlap @ 2021-04-26 18:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Ville Syrjälä,
	Jani Nikula, Damien Lespiau, Daniel Vetter, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, intel-gfx, dri-devel

When CONFIG_DRM_I915=y, CONFIG_ACPI is not set, and
CONFIG_BACKLIGHT_CLASS_DEVICE=m, not due to I915 config,
there are build errors trying to reference backlight_device_{un}register().

Changing the use of IS_ENABLED() to IS_REACHABLE() in intel_panel.[ch]
fixes this.

ld: drivers/gpu/drm/i915/display/intel_panel.o: in function `intel_backlight_device_register':
intel_panel.c:(.text+0x2ec1): undefined reference to `backlight_device_register'
ld: drivers/gpu/drm/i915/display/intel_panel.o: in function `intel_backlight_device_unregister':
intel_panel.c:(.text+0x2f93): undefined reference to `backlight_device_unregister'

ld: drivers/gpu/drm/i915/display/intel_panel.o: in function `intel_backlight_device_register':
intel_panel.c:(.text+0x2ec1): undefined reference to `backlight_device_register'
ld: drivers/gpu/drm/i915/display/intel_panel.o: in function `intel_backlight_device_unregister':
intel_panel.c:(.text+0x2f93): undefined reference to `backlight_device_unregister'

Fixes: 912e8b12eedb ("drm/i915: register backlight device also when backlight class is a module")
Fixes: 44c1220a441c ("drm/i915: extract intel_panel.h from intel_drv.h")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
---
Found in linux-next but applies to mainline (5.12).

 drivers/gpu/drm/i915/display/intel_panel.c |    2 +-
 drivers/gpu/drm/i915/display/intel_panel.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20210426.orig/drivers/gpu/drm/i915/display/intel_panel.c
+++ linux-next-20210426/drivers/gpu/drm/i915/display/intel_panel.c
@@ -1254,7 +1254,7 @@ void intel_panel_enable_backlight(const
 	mutex_unlock(&dev_priv->backlight_lock);
 }
 
-#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
 static u32 intel_panel_get_backlight(struct intel_connector *connector)
 {
 	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
--- linux-next-20210426.orig/drivers/gpu/drm/i915/display/intel_panel.h
+++ linux-next-20210426/drivers/gpu/drm/i915/display/intel_panel.h
@@ -54,7 +54,7 @@ u32 intel_panel_invert_pwm_level(struct
 u32 intel_panel_backlight_level_to_pwm(struct intel_connector *connector, u32 level);
 u32 intel_panel_backlight_level_from_pwm(struct intel_connector *connector, u32 val);
 
-#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
 int intel_backlight_device_register(struct intel_connector *connector);
 void intel_backlight_device_unregister(struct intel_connector *connector);
 #else /* CONFIG_BACKLIGHT_CLASS_DEVICE */

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-04-27 15:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 18:35 [PATCH] drm: i915: fix build when ACPI is disabled and BACKLIGHT=m Randy Dunlap
2021-04-26 18:35 ` [Intel-gfx] " Randy Dunlap
2021-04-26 18:35 ` Randy Dunlap
2021-04-26 19:56 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-04-26 20:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-04-27  5:08 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-04-27  8:03 ` [PATCH] " Jani Nikula
2021-04-27  8:03   ` [Intel-gfx] " Jani Nikula
2021-04-27  8:03   ` Jani Nikula
2021-04-27 15:31   ` Randy Dunlap
2021-04-27 15:31     ` [Intel-gfx] " Randy Dunlap
2021-04-27 15:31     ` Randy Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.