drivers/lib: Move mlx5_core configuration choice
Start skeleton for mlx5_core to be in drivers/lib.
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
diff --git a/drivers/lib/Kconfig b/drivers/lib/Kconfig
index 628bd77..253e65a 100644
--- a/drivers/lib/Kconfig
+++ b/drivers/lib/Kconfig
@@ -6,3 +6,7 @@
See Documentation/driver-api/lib.rst for more details.
If you don't know what to do here, say N.
+
+if DRIVERS_LIB
+source "drivers/lib/nvidia/Kconfig"
+endif #DRIVERS_LIB
diff --git a/drivers/lib/Makefile b/drivers/lib/Makefile
index f66554c..eae7509 100644
--- a/drivers/lib/Makefile
+++ b/drivers/lib/Makefile
@@ -1 +1,4 @@
# SPDX-License-Identifier: GPL-2.0
+
+# devices
+obj-y += nvidia/
diff --git a/drivers/lib/nvidia/Kconfig b/drivers/lib/nvidia/Kconfig
new file mode 100644
index 0000000..fb28f66
--- /dev/null
+++ b/drivers/lib/nvidia/Kconfig
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+config MLX5_CORE
+ tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
+ depends on PCI
+ select AUXILIARY_BUS
+ select NET_DEVLINK
+ depends on VXLAN || !VXLAN
+ depends on MLXFW || !MLXFW
+ depends on PTP_1588_CLOCK_OPTIONAL
+ depends on PCI_HYPERV_INTERFACE || !PCI_HYPERV_INTERFACE
+ depends on HWMON || !HWMON
+ help
+ Core driver for low level functionality of the ConnectX-4 and
+ Connect-IB cards by Mellanox Technologies.
diff --git a/drivers/lib/nvidia/Makefile b/drivers/lib/nvidia/Makefile
new file mode 100644
index 0000000..e1a8870
--- /dev/null
+++ b/drivers/lib/nvidia/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.
+
+obj-$(CONFIG_MLX5_CORE) += mlx5/
diff --git a/drivers/lib/nvidia/mlx5/Makefile b/drivers/lib/nvidia/mlx5/Makefile
new file mode 100644
index 0000000..a4e40e5
--- /dev/null
+++ b/drivers/lib/nvidia/mlx5/Makefile
@@ -0,0 +1 @@
+# SPDX-License-Identifier: GPL-2.0-only
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
index 691cd921..d8fbd2b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Kconfig
@@ -3,20 +3,6 @@
# Mellanox driver configuration
#
-config MLX5_CORE
- tristate "Mellanox 5th generation network adapters (ConnectX series) core driver"
- depends on PCI
- select AUXILIARY_BUS
- select NET_DEVLINK
- depends on VXLAN || !VXLAN
- depends on MLXFW || !MLXFW
- depends on PTP_1588_CLOCK_OPTIONAL
- depends on PCI_HYPERV_INTERFACE || !PCI_HYPERV_INTERFACE
- depends on HWMON || !HWMON
- help
- Core driver for low level functionality of the ConnectX-4 and
- Connect-IB cards by Mellanox Technologies.
-
config MLX5_FPGA
bool "Mellanox Technologies Innova support"
depends on MLX5_CORE
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/Makefile b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
index f23542e..6f678a2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/Makefile
+++ b/drivers/net/ethernet/mellanox/mlx5/core/Makefile
@@ -11,7 +11,7 @@
#
# mlx5 core basic
#
-mlx5_core-y := main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
+mlx5_core-y += main.o cmd.o debugfs.o fw.o eq.o uar.o pagealloc.o \
health.o mcg.o cq.o alloc.o port.o mr.o pd.o \
transobj.o vport.o sriov.o fs_cmd.o fs_core.o pci_irq.o \
fs_counters.o fs_ft_pool.o rl.o lag/debugfs.o lag/lag.o dev.o events.o wq.o lib/gid.o \