From patchwork Thu Feb 19 12:11:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Marek X-Patchwork-Id: 5851391 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29A7FBF440 for ; Thu, 19 Feb 2015 12:13:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 554FB20268 for ; Thu, 19 Feb 2015 12:13:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0AAEB20260 for ; Thu, 19 Feb 2015 12:13:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YOPxC-0000Gs-3J; Thu, 19 Feb 2015 12:11:38 +0000 Received: from cantor2.suse.de ([195.135.220.15] helo=mx2.suse.de) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YOPx6-0008TS-R5 for linux-arm-kernel@lists.infradead.org; Thu, 19 Feb 2015 12:11:33 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 85741AD88; Thu, 19 Feb 2015 12:11:08 +0000 (UTC) Received: by sepie.suse.cz (Postfix, from userid 10020) id A6D0040BD6; Thu, 19 Feb 2015 13:11:07 +0100 (CET) Date: Thu, 19 Feb 2015 13:11:07 +0100 From: Michal Marek To: Arnd Bergmann Subject: Re: [PATCH] [media] [kbuild] Add and use IS_REACHABLE macro Message-ID: <20150219121107.GA19684@sepie.suse.cz> References: <6116702.rrbrOqQ26P@wuerfel> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6116702.rrbrOqQ26P@wuerfel> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150219_041133_066136_36B35A79 X-CRM114-Status: GOOD ( 15.48 ) X-Spam-Score: -5.0 (-----) Cc: Mauro Carvalho Chehab , linux-kbuild@vger.kernel.org, Peter Senna Tschudin , linux-kernel@vger.kernel.org, Trent Piepho , Antti Palosaari , "Yann E. MORIN" , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 2015-02-18 18:12, Arnd Bergmann wrote: > In the media drivers, the v4l2 core knows about all submodules > and calls into them from a common function. However this cannot > work if the modules that get called are loadable and the > core is built-in. In that case we get > > drivers/built-in.o: In function `set_type': > drivers/media/v4l2-core/tuner-core.c:301: undefined reference to `tea5767_attach' > drivers/media/v4l2-core/tuner-core.c:307: undefined reference to `tea5761_attach' > drivers/media/v4l2-core/tuner-core.c:349: undefined reference to `tda9887_attach' > drivers/media/v4l2-core/tuner-core.c:405: undefined reference to `xc4000_attach' > [...] > Ideally Kconfig would be used to avoid the case of a broken dependency, > or the code restructured in a way to turn around the dependency, but either > way would require much larger changes here. What can be done without extending kbuild is to accept CONFIG_VIDEO_TUNER=y and CONFIG_MEDIA_TUNER_FOO=m, but build both into the kernel, e.g. Actually, I have hard time coming up with a kconfig syntactic sugar to express such dependency. If I understand it correctly, the valid configurations in this case are MEDIA_TUNER_TEA5767 n m y VIDEO_TUNER n x x x m x x x y x x I.e. only VIDEO_TUNER=y and MEDIA_TUNER_TEA5767=m is incorrect, isn't it? Thanks, Michal Acked-by: Michal Marek [kconfig] diff --git a/drivers/media/tuners/Kconfig b/drivers/media/tuners/Kconfig index 42e5a01..d2c7e89 100644 --- a/drivers/media/tuners/Kconfig +++ b/drivers/media/tuners/Kconfig @@ -71,6 +71,11 @@ config MEDIA_TUNER_TEA5767 help Say Y here to include support for the Philips TEA5767 radio tuner. +config MEDIA_TUNER_TEA5767_BUILD + tristate + default VIDEO_TUNER || MEDIA_TUNER_TEA5767 + depends on MEDIA_TUNER_TEA5767!=n + config MEDIA_TUNER_MSI001 tristate "Mirics MSi001" depends on MEDIA_SUPPORT && SPI && VIDEO_V4L2