Re: [PATCH net-next 1/3] mlx5: Move pci device handling from mlx5_ib to mlx5_core
From: Or Gerlitz <hidden>
Date: 2014-07-28 20:57:38
On Mon, Jul 28, 2014 at 11:30 PM, Eli Cohen [off-list ref] wrote: [...]
quoted hunk ↗ jump to hunk
--- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c@@ -54,96 +54,17 @@ MODULE_DESCRIPTION("Mellanox Connect-IB HCA >
[...] -static int prof_sel = 2;
-module_param_named(prof_sel, prof_sel, int, 0444); -MODULE_PARM_DESC(prof_sel, "profile selector. Valid range 0 - 2"); +static int deprecated_prof_sel = 2; +module_param_named(prof_sel, deprecated_prof_sel, int, 0444); +MODULE_PARM_DESC(prof_sel, "profile selector. Deprecated here. Moved to module mlx5_core");
[...]
quoted hunk ↗ jump to hunk
@@ -1340,28 +1260,19 @@ static int init_one(struct pci_dev *pdev, dev = (struct mlx5_ib_dev *)ib_alloc_device(sizeof(*dev)); if (!dev) - return -ENOMEM; + return NULL; - mdev = &dev->mdev; - mdev->event = mlx5_ib_event; - if (prof_sel >= ARRAY_SIZE(profile)) { - pr_warn("selected pofile out of range, selceting default\n"); - prof_sel = 0; - }
You need to issue a warning here if someone attempts to change the previously default value of the now deprecated module param. E.g warn this is deprecated and point them to mlx5_core
quoted hunk ↗ jump to hunk
- mdev->profile = &profile[prof_sel]; - err = mlx5_dev_init(mdev, pdev); - if (err) - goto err_free; + dev->mdev = mdev; err = get_port_caps(dev); if (err) - goto err_cleanup; + goto err_dealloc; get_ext_port_caps(dev); err = alloc_comp_eqs(dev); if (err) - goto err_cleanup; + goto err_dealloc; MLX5_INIT_DOORBELL_LOCK(&dev->uar_lock);@@ -1480,7 +1391,7 @@ static int init_one(struct pci_dev *pdev, dev->ib_active = true; - return 0; + return dev; err_umrc: destroy_umrc_res(dev);