浏览代码

mlxfw: Make the module selectable

There are upcoming NIC (mlx5) use-cases where people want to avoid
building the mlxfw module, allow for that. The mlxsw module is
untouched and keeps selecting mlxfw.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Acked-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Or Gerlitz 8 年之前
父节点
当前提交
c2df61376b
共有 2 个文件被更改,包括 16 次插入1 次删除
  1. 7 1
      drivers/net/ethernet/mellanox/mlxfw/Kconfig
  2. 9 0
      drivers/net/ethernet/mellanox/mlxfw/mlxfw.h

+ 7 - 1
drivers/net/ethernet/mellanox/mlxfw/Kconfig

@@ -3,5 +3,11 @@
 #
 #
 
 
 config MLXFW
 config MLXFW
-        tristate "mlxfw" if COMPILE_TEST
+	tristate "Mellanox Technologies firmware flash module"
+	---help---
+	  This driver supports Mellanox Technologies Firmware
+	  flashing common logic.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called mlxfw.
 	select XZ_DEC
 	select XZ_DEC

+ 9 - 0
drivers/net/ethernet/mellanox/mlxfw/mlxfw.h

@@ -96,7 +96,16 @@ struct mlxfw_dev {
 	u16 psid_size;
 	u16 psid_size;
 };
 };
 
 
+#if IS_ENABLED(CONFIG_MLXFW)
 int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev,
 int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev,
 			 const struct firmware *firmware);
 			 const struct firmware *firmware);
+#else
+static inline
+int mlxfw_firmware_flash(struct mlxfw_dev *mlxfw_dev,
+			 const struct firmware *firmware)
+{
+	return -EOPNOTSUPP;
+}
+#endif
 
 
 #endif
 #endif