Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8483549ybn; Tue, 1 Oct 2019 08:44:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWpxR32B14v8cO5syoil0eo3ibaxJGiKkELoJpSXchQFqbGKgDBqQcNgMSr1ZZGKKRyWUD X-Received: by 2002:a50:eb8b:: with SMTP id y11mr25651277edr.200.1569944671164; Tue, 01 Oct 2019 08:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569944671; cv=none; d=google.com; s=arc-20160816; b=E8zptF48qYzoYmc9CJV0YonUOoxXV1GdmA9xO3WbjApNjmrBjY04IqlLPa6iO+WEG7 I6asqBesZC8FPsVZAmLqZw9/AWYooWhX18HLjXtCZuBSlBTDUPxeeM2I9C4R2862pGwT 76kHxaxpzGY4hxopSR/kIygOEgrG7VoCx1QHyxiIXQJzwBtwdbLPdmqSwTCmFBTcfEpy +ZwBKS2BbUrG7PPlSp/ZkuFfLCjXT5oCwK2FJ+YCm7OT6HyNy3JX5EPehmPavhssnqo7 puhb71iZcJhrCipiEr98Zv3UMa/zJDfmkpCuqXjPamYP490HM2272u6NZFc6fi25Lgvs AN6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=PYNED/gHAQZWO+3A/3UN+zfY12A/7ApPwVWXSrVnRe4=; b=FA080kKxfD/3qmSzvU0SmuZQEiDt2MIFzLHxJTEuyMMBGR43S1pYOn9N4tEoCbiayO 1WC2fXtemXaSiqkoXZOd1gfX0ohWD1Qy1iSL5J8eL9yBn+YBZrDo78mNgtG5CwHv9IGY /BQuDXjv2l+tku5H18nL+Lse79D9801s8cjuF9euN9d59Ct8NJY7Tqg0THE+h6h9yG2l KfFeTRAIUn2nVKuQ0GKXYzygRPAaV+uptCuOrWd7/1SvWFExRhhz7LLOfAtrstVQmam7 FdDYrWoyMM6ltlADKfxafyZho7NloACraz9vtz8Goafg7gn0wfFIodcVoS1pRZxAY3J1 zaJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z6si8798318edr.443.2019.10.01.08.44.06; Tue, 01 Oct 2019 08:44:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389672AbfJAPlg (ORCPT + 99 others); Tue, 1 Oct 2019 11:41:36 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:45168 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727362AbfJAPlg (ORCPT ); Tue, 1 Oct 2019 11:41:36 -0400 Received: by mail-qk1-f193.google.com with SMTP id z67so11633378qkb.12 for ; Tue, 01 Oct 2019 08:41:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PYNED/gHAQZWO+3A/3UN+zfY12A/7ApPwVWXSrVnRe4=; b=a3TMZmfnbJjCLYH1LB9WvSN/CCMSEoVs0M+szws6OvlSCT5HBQObqMnFTKhGPP1dHJ OFYMZaBdIgnnBZuy4leXBK2LbwiLMMxG7oRmlQ3ECe12jBWtDVqG9CptKgLNTn35oR/J 8zqBlw1NIjHugDpzt7bVq10smPnqhHC3d1wfYteN5+/FkviDyBS+nDxeyE39IW/sOyHu vaVzM2zBHqh8cn2XD1LJo5ZGboKKr02RrA2xaodu5IGBb95yTFi2BhxVukf9J6r6h6rr H0qaXMOuldQo3JwcC8mdnXc4/+kSZFvCxrFWlF5GpdpzGug6DGVuo9f1qbvK8Ljd1Gwi zE0Q== X-Gm-Message-State: APjAAAV9OmnsUtuX0+DV20FgGgm/1ChEsvShWQTTORJJRBQBg0hAXs7t jIgGCIFw/f/paE9aLWMDPBtlg4/hkOd5LiCXibA= X-Received: by 2002:a37:a858:: with SMTP id r85mr6681072qke.394.1569944495423; Tue, 01 Oct 2019 08:41:35 -0700 (PDT) MIME-Version: 1.0 References: <20191001142026.1124917-1-arnd@arndb.de> In-Reply-To: From: Arnd Bergmann Date: Tue, 1 Oct 2019 17:41:19 +0200 Message-ID: Subject: Re: [alsa-devel] [PATCH] ASoC: SOF: imx: fix reverse CONFIG_SND_SOC_SOF_OF dependency To: Pierre-Louis Bossart Cc: Mark Brown , Hulk Robot , YueHaibing , Daniel Baluta , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , ALSA Development Mailing List , Linux ARM , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 1, 2019 at 5:32 PM Pierre-Louis Bossart wrote: > On 10/1/19 9:20 AM, Arnd Bergmann wrote: > > CONFIG_SND_SOC_SOF_IMX depends on CONFIG_SND_SOC_SOF, but is in > > turn referenced by the sof-of-dev driver. This creates a reverse > > dependency that manifests in a link error when CONFIG_SND_SOC_SOF_OF > > is built-in but CONFIG_SND_SOC_SOF_IMX=m: > > > > sound/soc/sof/sof-of-dev.o:(.data+0x118): undefined reference to `sof_imx8_ops' > > > > Make the latter a 'bool' symbol and change the Makefile so the imx8 > > driver is compiled the same way as the driver using it. > > > > A nicer way would be to reverse the layering and move all > > the imx specific bits of sof-of-dev.c into the imx driver > > itself, which can then call into the common code. Doing this > > would need more testing and can be done if we add another > > driver like the first one. > > Or use something like > > config SND_SOC_SOF_IMX8_SUPPORT > bool "SOF support for i.MX8" > depends on IMX_SCU > depends on IMX_DSP > > config SND_SOC_SOF_IMX8 > tristate > > > config SND_SOC_SOF_OF > depends on OF > select SND_SOC_SOF_IMX8 if SND_SOC_SOF_IMX8_SUPPORT > > That way you propagate the module/built-in information. That's how we > fixed those issues for the Intel parts. Yes, I think that would work here as well, but it keeps even more information about the specific drivers in the generic code. It also requires adding more 'select' statements that tend to cause more problems. The same could be done with a Kconfig-only solution avoiding 'select' such as: config SND_SOC_SOF_IMX8_SUPPORT bool "SOF support for i.MX8" depends on IMX_SCU depends on IMX_DSP config SND_SOC_SOF_IMX8 def_tristate SND_SOC_SOF_OF depends on SND_SOC_SOF_IMX8_SUPPORT Arnd