From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60A7BC352AA for ; Tue, 1 Oct 2019 15:41:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26F9121855 for ; Tue, 1 Oct 2019 15:41:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rf0b80BV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26F9121855 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GWw5DF2sawG3tXKngsEwI14iAyQkReS2Ub/mPdT3eNU=; b=rf0b80BVAW/bPf wLRx8wL/hKtB56wT4woWyOv51bD70xIOZXeN0vdizIbbeGPpaTaNBDYhkbH7umb9tOPZtXb4c1hHw f2bllLzRiiOPLYeFxmVmbYkbzEE6m2JwqzAOYStmohq46mM0JQOtSi5NCcBEzvqPHVzVqpwVDovK2 y1wskhg79Sii3DtxTms0n/jH6HhQVvWAGMRg2aJFCgGcaSu2G+4/VSuw41pUVA+eM3CZqOllMr5Oj 7vHyLlB4PEwrhjbB90FQDCTWguj3+Z4AySZhPSoTTAQ9ocJzRS6SSiKyGnSnhEl2j8I2AHYlrfNiP 9rjNNGhh5iYIPvM5yxDA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFKHU-0005lG-CP; Tue, 01 Oct 2019 15:41:40 +0000 Received: from mail-qk1-f195.google.com ([209.85.222.195]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iFKHR-0005jm-1O for linux-arm-kernel@lists.infradead.org; Tue, 01 Oct 2019 15:41:38 +0000 Received: by mail-qk1-f195.google.com with SMTP id w2so11681831qkf.2 for ; Tue, 01 Oct 2019 08:41:36 -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=ahW8tJsmpk1QjYwphSoZQLqxwSCJP22sap8rBcrSLJKFGRo0YpXYmZxWUCd/Dc+lny DwBOO+2wcUFLQoXdYJyPVmTysyRwAfA4Dnc5nvalFEHf0Tp9I4SmoFYZwIVyVzeKUffE wMtZRBEv5IJt8ga6Basf/8A8aD5sG1hC9G5beuwX3L1Bwo9x0fairzw6LkRFRoKrRNN5 NEF/pU2mOCm+cxlohUu7DtSnVYRsn27B7sVyB/3Dii+c+8UAdNU/Ui4sdVUTxGUEtmYE A+a1BQ2q+i7BMlrkDzCuP3wyNfDgpMet64VwKP/o7n+yZua3r8CWU3Co/kWYCzdimduO l2RQ== X-Gm-Message-State: APjAAAUOfig9PYJtvw061gkPlsrolzNFa69C+tBvTwUJlpbWgV0AaP7a onj7PVBMO2MuOA1f4b+hyeNKI5H44CtUBCaU48Y= X-Google-Smtp-Source: APXvYqzYVsIwghV1g7M189GjA1p2gl/d+MucD1KvbEioKPUwygJiOOw9tiSuacOJf+g/Fbf9+E9jGyNtKXcZR+sjTxc= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191001_084137_085655_41F0BCFC X-CRM114-Status: GOOD ( 18.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ALSA Development Mailing List , Fabio Estevam , "linux-kernel@vger.kernel.org" , Shawn Guo , Sascha Hauer , Takashi Iwai , YueHaibing , Liam Girdwood , Jaroslav Kysela , Hulk Robot , Mark Brown , NXP Linux Team , Pengutronix Kernel Team , Daniel Baluta , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel