From: Arnd Bergmann <arnd@arndb.de>
To: Lee Jones <lee.jones@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Rob Herring <robh@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Hans de Goede <hdegoede@redhat.com>,
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 [thread overview]
Message-ID: <20170609104510.3420617-1-arnd@arndb.de> (raw)
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 <arnd@arndb.de>
---
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
--
2.9.0
next reply other threads:[~2017-06-09 10:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 10:44 Arnd Bergmann [this message]
2017-06-09 11:31 ` Hans de Goede
2017-06-09 11:49 ` Andy Shevchenko
2017-06-09 11:54 ` Hans de Goede
2017-06-15 8:09 ` Lee Jones
2017-06-15 13:07 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170609104510.3420617-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®