platform: mellanox: select REGMAP instead of depending on it
authorRandy Dunlap <rdunlap@infradead.org>
Sun, 26 Feb 2023 05:39:50 +0000 (21:39 -0800)
committerHans de Goede <hdegoede@redhat.com>
Tue, 7 Mar 2023 10:37:27 +0000 (11:37 +0100)
REGMAP is a hidden (not user visible) symbol. Users cannot set it
directly thru "make *config", so drivers should select it instead of
depending on it if they need it.

Consistently using "select" or "depends on" can also help reduce
Kconfig circular dependency issues.

Therefore, change the use of "depends on REGMAP" to "select REGMAP".

For NVSW_SN2201, select REGMAP_I2C instead of depending on it.

Fixes: c6acad68eb2d ("platform/mellanox: mlxreg-hotplug: Modify to use a regmap interface")
Fixes: 5ec4a8ace06c ("platform/mellanox: Introduce support for Mellanox register access driver")
Fixes: 62f9529b8d5c ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
Fixes: 662f24826f95 ("platform/mellanox: Add support for new SN2201 system")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Michael Shych <michaelsh@nvidia.com>
Cc: Mark Gross <markgross@kernel.org>
Cc: Vadim Pasternak <vadimp@nvidia.com>
Cc: platform-driver-x86@vger.kernel.org
Link: https://lore.kernel.org/r/20230226053953.4681-6-rdunlap@infradead.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/mellanox/Kconfig

index 09c7829..382793e 100644 (file)
@@ -16,17 +16,17 @@ if MELLANOX_PLATFORM
 
 config MLXREG_HOTPLUG
        tristate "Mellanox platform hotplug driver support"
-       depends on REGMAP
        depends on HWMON
        depends on I2C
+       select REGMAP
        help
          This driver handles hot-plug events for the power suppliers, power
          cables and fans on the wide range Mellanox IB and Ethernet systems.
 
 config MLXREG_IO
        tristate "Mellanox platform register access driver support"
-       depends on REGMAP
        depends on HWMON
+       select REGMAP
        help
          This driver allows access to Mellanox programmable device register
          space through sysfs interface. The sets of registers for sysfs access
@@ -36,9 +36,9 @@ config MLXREG_IO
 
 config MLXREG_LC
        tristate "Mellanox line card platform driver support"
-       depends on REGMAP
        depends on HWMON
        depends on I2C
+       select REGMAP
        help
          This driver provides support for the Mellanox MSN4800-XX line cards,
          which are the part of MSN4800 Ethernet modular switch systems
@@ -80,10 +80,9 @@ config MLXBF_PMC
 
 config NVSW_SN2201
        tristate "Nvidia SN2201 platform driver support"
-       depends on REGMAP
        depends on HWMON
        depends on I2C
-       depends on REGMAP_I2C
+       select REGMAP_I2C
        help
          This driver provides support for the Nvidia SN2201 platform.
          The SN2201 is a highly integrated for one rack unit system with