Content-Type: multipart/mixed; boundary="===============2007924830154890833==" MIME-Version: 1.0 From: Vinod Koul To: kbuild-all@lists.01.org Subject: Re: drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus' Date: Wed, 25 Nov 2020 11:21:55 +0530 Message-ID: <20201125055155.GD8403@vkoul-mobl> In-Reply-To: List-Id: --===============2007924830154890833== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Randy, On 04-11-20, 19:32, Randy Dunlap wrote: > On 11/2/20 11:47 AM, kernel test robot wrote: > > All errors (new ones prefixed by >>): > > = > > or1k-linux-ld: drivers/soundwire/qcom.o: in function `qcom_swrm_prob= e': > >>> drivers/soundwire/qcom.c:767: undefined reference to `slimbus_bus' > >>> or1k-linux-ld: drivers/soundwire/qcom.c:771: undefined reference to `= slimbus_bus' > > = > > 09309093d5e8f87 Jonathan Marek 2020-09-08 770 #if IS_ENABLED(CO= NFIG_SLIMBUS) > > 02efb49aa805cee Srinivas Kandagatla 2020-01-13 @771 if (dev->parent-= >bus =3D=3D &slimbus_bus) { > > 5bd773242f75da3 Jonathan Marek 2020-09-05 772 #else > > 5bd773242f75da3 Jonathan Marek 2020-09-05 773 if (false) { > > 5bd773242f75da3 Jonathan Marek 2020-09-05 774 #endif > = > config SOUNDWIRE_QCOM > tristate "Qualcomm SoundWire Master driver" > imply SLIMBUS > depends on SND_SOC > = > The kernel config that was attached has: > CONFIG_SOUNDWIRE_QCOM=3Dy > CONFIG_SLIMBUS=3Dm > = > I expected that "imply" would make SLIMBUS=3Dy since SOUNDWIRE_QCOM=3Dy, > but I guess that's not the case. :( > = > Any ideas about what to do here? Sorry to have missed this earlier. I did some digging and found the Kconfig code to be correct, but not the driver code. Per the Documentation if we are using imply we should use IS_REACHABLE() rather than IS_ENABLED. This seems to take care of build failure for me on arm64 and x64 builds. Can you confirm with below patch: ---><8--- From: Vinod Koul Date: Wed, 25 Nov 2020 11:15:22 +0530 Subject: [PATCH] soundwire: qcom: Fix build failure when slimbus is module Commit 5bd773242f75 ("soundwire: qcom: avoid dependency on CONFIG_SLIMBUS") removed hard dependency on Slimbus for qcom driver but it results in build failure when: CONFIG_SOUNDWIRE_QCOM=3Dy CONFIG_SLIMBUS=3Dm drivers/soundwire/qcom.o: In function `qcom_swrm_probe': qcom.c:(.text+0xf44): undefined reference to `slimbus_bus' Fix this by using IS_REACHABLE() in driver which is recommended to be sued with imply. Fixes: 5bd773242f75 ("soundwire: qcom: avoid dependency on CONFIG_SLIMBUS") Reported-by: kernel test robot Signed-off-by: Vinod Koul --- drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index fbca4ebf63e9..6d22df01f354 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -799,7 +799,7 @@ static int qcom_swrm_probe(struct platform_device *pdev) data =3D of_device_get_match_data(dev); ctrl->rows_index =3D sdw_find_row_index(data->default_rows); ctrl->cols_index =3D sdw_find_col_index(data->default_cols); -#if IS_ENABLED(CONFIG_SLIMBUS) +#if IS_REACHABLE(CONFIG_SLIMBUS) if (dev->parent->bus =3D=3D &slimbus_bus) { #else if (false) { -- = 2.26.2 -- = ~Vinod --===============2007924830154890833==--