linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Randy Dunlap <rdunlap@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: Randy Dunlap <rdunlap@infradead.org>,
	kernel test robot <lkp@intel.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	dri-devel@lists.freedesktop.org,
	linux-renesas-soc@vger.kernel.org,
	Jacopo Mondi <jacopo+renesas@jmondi.org>
Subject: [PATCH v2] drm: rcar-du: fix linker undefined references
Date: Fri, 23 Apr 2021 17:12:14 -0700	[thread overview]
Message-ID: <20210424001214.30642-1-rdunlap@infradead.org> (raw)

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__ */

             reply	other threads:[~2021-04-24  0:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-24  0:12 Randy Dunlap [this message]
2021-05-15  0:37 ` [PATCH v2] drm: rcar-du: fix linker undefined references Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210424001214.30642-1-rdunlap@infradead.org \
    --to=rdunlap@infradead.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).