From patchwork Fri Jun 9 10:44:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 103467 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp144377qgd; Fri, 9 Jun 2017 03:45:56 -0700 (PDT) X-Received: by 10.84.217.73 with SMTP id e9mr28947588plj.133.1497005156002; Fri, 09 Jun 2017 03:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497005155; cv=none; d=google.com; s=arc-20160816; b=dZHHgzJf6Pj1gP+edsf/t/bD91IVda6ysj1zXiq/Jk9duDiuoICh6JYZPWFaxDJUfK GDJh1x/iid5iMmlYzsgiGlzjYT3mtGjNVXCQ4fwW1ofBQBdNDW82K8hn/Eqf59yu6zoT JjEZp//EsXqJCLvlDYuXlNjfEEm2MlrMpSphwXiIn5/J4Z8ICW93RwQ8W32mIFkufg1X OF8PF6Z+LykLBfuR9SaT8hfyJq1BaExPMUX3gQ8hFvPJ4qK1IkwWohAdbeHHqwiZ1S+Z PGEghMAmkFde3i9aSNbrMpzjEjVl6P1YFsVVitvaR74JXFn+y7QfksgBIbQhi3xghMOE wipQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=eqCUgG+uxRyuYyeL6nS4VmEqoxxEgsXwm/0grCaGU5c=; b=M5apbjRKEHEUUNNU5rzP2YtROVgScviswmgnb5o4a5Ek2axb9AIrJoN/itmzMGwAIw ponHpPJO0dyS3HuZPbyzmSSB4ThFu4X3kJh6mVVdG2OhQUtq3pBS4HqGPD5lLmq1+c2/ 9anfMdRAjtu5BsOg3/+qIiL6K5TSGtYuIM4y1TyGeJXAqIcQ9LzotpcuVSuvdjnxqYRd qQJ+ZZskAOiH8rY68Dhj4DQ2RPRjANi929WeJsMB7fL1NoaIVrAH0avESP3vRG3lGSfD OEViuzB6xRbD9jqRAy9kg8w8V2uQk2qG9GAmdk2s6curvt05BKxeeZmE4KASRhuvGgxC Hl4A== 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 k1si656768pld.526.2017.06.09.03.45.55; Fri, 09 Jun 2017 03:45:55 -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 S1751676AbdFIKpn (ORCPT + 25 others); Fri, 9 Jun 2017 06:45:43 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:62829 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbdFIKpk (ORCPT ); Fri, 9 Jun 2017 06:45:40 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.145]) with ESMTPA (Nemesis) id 0MCZ7q-1d9tkM3e6c-009OwI; Fri, 09 Jun 2017 12:45:16 +0200 From: Arnd Bergmann To: Lee Jones Cc: Arnd Bergmann , Rob Herring , Andy Shevchenko , Hans de Goede , linux-kernel@vger.kernel.org Subject: [PATCH] mfd: intel_soc_pmic: use 'depends on' instead of 'select' Date: Fri, 9 Jun 2017 12:44:44 +0200 Message-Id: <20170609104510.3420617-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:1xrabahrK5PuSSWBMQIHB5L+/tDj/BXWWWaXeTtx266fbnyp2Rd HQvTaBdLwZojMTlCyAYhpGlO1u8er5JUShjzKn9ZTCRZi8HJifc2LpvpGk3nhXf+U5CL94r p8Ta0tOROMxA6umt894T5p+mmUgYbHm/2PVlhTK/WTnKAKj+SQtUk0Kv1w/kGZiwIOe5cN3 Pp7LV9G5brapEC2wAoJ9Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:XTmJHTutQ60=:Bo2Jmv/GJskOICNIjdnt2X qGEbvJiijKcPWatD8MX4hyqO5hxCKFdlw3p+6LvrdatBCUtVQesdwJgCDnOUIlt8pjqs/PLnm oiPO/8yAoqwkCO0qmdw06m4sjuMxgpvtdcgdRNCTnCrk3w28AELNj4/MrlNEWm6VbAYH14qkI mPV7SUz93fqrV/VzJ16nWJzPN3AHSGKRBGjIpfd0eQX4nOayjCLIuMEoMVBaq2xu8L7sD8fog czgNkbMviRDRGjUd+v+j5mm0J4/tnKRrAEzGd0nFaZUPMx350rTh/7CsvWgcCzXOLdea/oWtn 0NSc5ml+MKfVF3qb0aYyTRyugd/HiZUL/US4HhQz3wp83Te4dSSjHZImAso7jYh4wWoACSGIN 3FaiehlleShOBGbfPwCaAC3CAGUgo8SJp+WJTsGQph67k6mtXXcS0OtYy6/vh/hEwdENXEtMz XaeWLTJe4oBVsAccC05WHREX3W7IxF3+yx5QtV7PzKgNCYql+D7txUqXGRUWKmxBhbSWQ6JVM jabGrDHwyFD4TOfjr4KShphWhbMV55Kt/HkIDILMnjEr3QIl/KXtR7ohgU0mpsoZA3E0dS0T5 ikl1RYyn6Aak3ZoPlgw5gXtchR1L1H+vKoSS1qliILIpfAIlxV6fYLLGiaZWsagt9VHcmA1wk vpyWbAgmNu2A2wxx5CMXRGoTyTx5TJ4hDSuqpsIztW4GWu2jNdEo2lpUUnFbD4FrSQhQ= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I ran into a build error on ARM with a platform that has a non-standard clk implementation: drivers/clk/clk.o: In function `clk_disable': clk.c:(.text.clk_disable+0x0): multiple definition of `clk_disable' arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_disable+0x0): first defined here drivers/clk/clk.o: In function `clk_enable': clk.c:(.text.clk_enable+0x0): multiple definition of `clk_enable' arch/arm/mach-omap1/clock.o:clock.c:(.text.clk_enable+0x0): first defined here The problem is a device driver that uses 'select COMMON_CLK', which is generally a bad idea: selecting a subsystem should only be done from a platform, otherwise we run into circular dependencies. The same driver also selects 'GPIOLIB' and 'I2C', which has a similar effect. This turns all three into 'depends on', as it should be. The same pattern exists for INTEL_SOC_PMIC and INTEL_SOC_PMIC_CHTWC, so we fix both the same way to keep them in sync. INTEL_SOC_PMIC does not depend on ACPI, so we don't need to 'select' the I2C master driver when ACPI is disabled. Finally, we can limit the build to x86, unless we are compile testing. Fixes: 2f91ded5f8f4 ("mfd: Add Cherry Trail Whiskey Cove PMIC driver") Fixes: 5f125f1f5705 ("mfd: intel_soc_pmic: Select designware i2c-bus driver") Signed-off-by: Arnd Bergmann --- drivers/mfd/Kconfig | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) -- 2.9.0 Acked-by: Hans de Goede Reviewed-by: Andy Shevchenko diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index ea5daa935518..74fa52582f06 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -454,14 +454,12 @@ config LPC_SCH config INTEL_SOC_PMIC bool "Support for Crystal Cove PMIC" - depends on HAS_IOMEM - select GPIOLIB - select I2C + depends on HAS_IOMEM && I2C=y && GPIOLIB && COMMON_CLK + depends on X86 || COMPILE_TEST select MFD_CORE select REGMAP_I2C select REGMAP_IRQ - select COMMON_CLK - select I2C_DESIGNWARE_PLATFORM + select I2C_DESIGNWARE_PLATFORM if ACPI help Select this option to enable support for Crystal Cove PMIC on some Intel SoC systems. The PMIC provides ADC, GPIO, @@ -484,13 +482,12 @@ config INTEL_SOC_PMIC_BXTWC on these systems. config INTEL_SOC_PMIC_CHTWC - bool "Support for Intel Cherry Trail Whiskey Cove PMIC" - depends on ACPI && HAS_IOMEM + tristate "Support for Intel Cherry Trail Whiskey Cove PMIC" + depends on ACPI && HAS_IOMEM && I2C=y && COMMON_CLK + depends on X86 || COMPILE_TEST select MFD_CORE - select I2C select REGMAP_I2C select REGMAP_IRQ - select COMMON_CLK select I2C_DESIGNWARE_PLATFORM help Select this option to enable support for the Intel Cherry Trail