Change the Kconfig dependency to (I2C || SPI) so that it doesn't
require both bus subsystems to be enabled. Make a few small changes to
the code so that the code for a bus is only called if the bus is being
built.
When SPI support was added to serial-multi-instantiate it created a
dependency that both CONFIG_I2C and CONFIG_SPI must be enabled.
Typically they are, but there's no reason why this should be a
requirement. A specific kernel build could have only I2C devices or
only SPI devices. It should be possible to use serial-multi-instantiate
if only I2C or only SPI is enabled.
Signed-off-by: Richard Fitzgerald <rf@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/platform/x86/Kconfig | 2 +-
.../platform/x86/serial-multi-instantiate.c | 32 ++++++++++++++-----
2 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 665fa9524986..c286742b34ba 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -999,7 +999,7 @@ config TOPSTAR_LAPTOP
config SERIAL_MULTI_INSTANTIATE
tristate "Serial bus multi instantiate pseudo device driver"
- depends on I2C && SPI && ACPI
+ depends on (I2C || SPI) && ACPI