From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751566AbdFILyt (ORCPT ); Fri, 9 Jun 2017 07:54:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36468 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751524AbdFILys (ORCPT ); Fri, 9 Jun 2017 07:54:48 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DFCDBC057FA7 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=hdegoede@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DFCDBC057FA7 Subject: Re: [PATCH] mfd: intel_soc_pmic: use 'depends on' instead of 'select' To: Andy Shevchenko , Arnd Bergmann , Lee Jones Cc: Rob Herring , linux-kernel@vger.kernel.org References: <20170609104510.3420617-1-arnd@arndb.de> <26f43c8d-cf43-5edb-c30a-6ef2169f84b5@redhat.com> <1497008999.22624.77.camel@linux.intel.com> From: Hans de Goede Message-ID: Date: Fri, 9 Jun 2017 13:54:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1497008999.22624.77.camel@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 09 Jun 2017 11:54:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 09-06-17 13:49, Andy Shevchenko wrote: > On Fri, 2017-06-09 at 13:31 +0200, Hans de Goede wrote: >> Hi, >> >> On 09-06-17 12:44, Arnd Bergmann wrote: >>> 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 >> >> Looks good to me: >> >> Acked-by: Hans de Goede > > No objections if it works for Hans' case. Yes I checked my .config stays the same with a "make oldconfig" and this patch. Regards, Hans > > Reviewed-by: Andy Shevchenko > >> >> Regards, >> >> Hans >> >> >> >>> --- >>> drivers/mfd/Kconfig | 15 ++++++--------- >>> 1 file changed, 6 insertions(+), 9 deletions(-) >>> >>> 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 >>> >