All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm: rcar-du: fix linker undefined references
@ 2021-04-24  0:12 ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-04-24  0:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, Masahiro Yamada,
	Laurent Pinchart, Kieran Bingham, dri-devel, linux-renesas-soc,
	Jacopo Mondi

When DRM_RCAR_DU=y and DRM_RCAR_LVDS=m, there are several build errors
as reported by 'kernel test robot'. These can be corrected by changing
source code occurrences of IS_ENABLED(...) to IS_REACHABLE(...).

In looking at this, the same problem (build errors) happens when
DRM_RCAR_DU=y and DRM_RCAR_CMM=m, so again change an IS_ENABLED()
to IS_REACHABLE() for this case as well.

These changes fix the following 8 build/link errors:

aarch64-linux-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_enable':
rcar_du_crtc.c:(.text+0x1be8): undefined reference to `rcar_lvds_clk_enable'
aarch64-linux-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_disable':
rcar_du_crtc.c:(.text+0x2438): undefined reference to `rcar_lvds_clk_disable'
aarch64-linux-ld: drivers/gpu/drm/rcar-du/rcar_du_drv.o: in function `rcar_du_init':
rcar_du_drv.c:(.init.text+0x14): undefined reference to `rcar_du_of_init'
aarch64-linux-ld: drivers/gpu/drm/rcar-du/rcar_du_encoder.o: in function `rcar_du_encoder_init':
rcar_du_encoder.c:(.text+0x1d4): undefined reference to `rcar_lvds_dual_link'

aarch64-linux-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_cmm_setup':
rcar_du_crtc.c:(.text+0x380): undefined reference to `rcar_cmm_setup'
aarch64-linux-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_enable':
rcar_du_crtc.c:(.text+0x1c08): undefined reference to `rcar_cmm_enable'
aarch64-linux-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_disable':
rcar_du_crtc.c:(.text+0x231c): undefined reference to `rcar_cmm_disable'
aarch64-linux-ld: drivers/gpu/drm/rcar-du/rcar_du_kms.o: in function `rcar_du_modeset_init':
rcar_du_kms.c:(.text+0xd08): undefined reference to `rcar_cmm_init'

All RCAR kconfig combinations now build for me.

Fixes: e08e934d6c28 ("drm: rcar-du: Add support for CMM")
Fixes: 02f2b30032c1 ("drm: rcar-du: lvds: Add API to enable/disable clock output")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
---
v2: also send to LKML;
    don't change Kconfig "imply" to "select" since not all platforms
    with DU have CMM and/or LVDS support. Use IS_REACHABLE() instead.

 drivers/gpu/drm/rcar-du/rcar_cmm.h   |    4 ++--
 drivers/gpu/drm/rcar-du/rcar_du_of.h |    2 +-
 drivers/gpu/drm/rcar-du/rcar_lvds.h  |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

--- linux-next-20210420.orig/drivers/gpu/drm/rcar-du/rcar_lvds.h
+++ linux-next-20210420/drivers/gpu/drm/rcar-du/rcar_lvds.h
@@ -12,7 +12,7 @@
 
 struct drm_bridge;
 
-#if IS_ENABLED(CONFIG_DRM_RCAR_LVDS)
+#if IS_REACHABLE(CONFIG_DRM_RCAR_LVDS)
 int rcar_lvds_clk_enable(struct drm_bridge *bridge, unsigned long freq);
 void rcar_lvds_clk_disable(struct drm_bridge *bridge);
 bool rcar_lvds_dual_link(struct drm_bridge *bridge);
--- linux-next-20210420.orig/drivers/gpu/drm/rcar-du/rcar_du_of.h
+++ linux-next-20210420/drivers/gpu/drm/rcar-du/rcar_du_of.h
@@ -11,7 +11,7 @@
 
 struct of_device_id;
 
-#if IS_ENABLED(CONFIG_DRM_RCAR_LVDS)
+#if IS_REACHABLE(CONFIG_DRM_RCAR_LVDS)
 void __init rcar_du_of_init(const struct of_device_id *of_ids);
 #else
 static inline void rcar_du_of_init(const struct of_device_id *of_ids) { }
--- linux-next-20210420.orig/drivers/gpu/drm/rcar-du/rcar_cmm.h
+++ linux-next-20210420/drivers/gpu/drm/rcar-du/rcar_cmm.h
@@ -25,7 +25,7 @@ struct rcar_cmm_config {
 	} lut;
 };
 
-#if IS_ENABLED(CONFIG_DRM_RCAR_CMM)
+#if IS_REACHABLE(CONFIG_DRM_RCAR_CMM)
 int rcar_cmm_init(struct platform_device *pdev);
 
 int rcar_cmm_enable(struct platform_device *pdev);
@@ -53,6 +53,6 @@ static inline int rcar_cmm_setup(struct
 {
 	return 0;
 }
-#endif /* IS_ENABLED(CONFIG_DRM_RCAR_CMM) */
+#endif /* IS_REACHABLE(CONFIG_DRM_RCAR_CMM) */
 
 #endif /* __RCAR_CMM_H__ */

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

end of thread, other threads:[~2021-05-15  0:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-24  0:12 [PATCH v2] drm: rcar-du: fix linker undefined references Randy Dunlap
2021-04-24  0:12 ` Randy Dunlap
2021-05-15  0:37 ` Randy Dunlap
2021-05-15  0:37   ` 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.