]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
net/mlx5: Continue driver initialization despite debugfs failure
authorLeon Romanovsky <leonro@mellanox.com>
Thu, 13 Dec 2018 11:15:11 +0000 (13:15 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Mon, 17 Dec 2018 22:35:25 +0000 (14:35 -0800)
The failure to create debugfs entry is unpleasant event, but not enough
to abort drier initialization. Align the mlx5_core code to debugfs design
and continue execution whenever debugfs_create_dir() successes or not.

Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/main.c

index 7789955738127c3d3382dbe64fc540ea14996f8f..93fa48a7eabbe04f5c8bd945ab5ac1c617e3dfd3 100644 (file)
@@ -661,11 +661,9 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct mlx5_priv *priv)
 
        priv->numa_node = dev_to_node(&dev->pdev->dev);
 
-       priv->dbg_root = debugfs_create_dir(dev_name(&pdev->dev), mlx5_debugfs_root);
-       if (!priv->dbg_root) {
-               dev_err(&pdev->dev, "Cannot create debugfs dir, aborting\n");
-               return -ENOMEM;
-       }
+       if (mlx5_debugfs_root)
+               priv->dbg_root =
+                       debugfs_create_dir(pci_name(pdev), mlx5_debugfs_root);
 
        err = mlx5_pci_enable_device(dev);
        if (err) {