net/mlx5: Make mlx5_core messages independent from mdev->pdev
authorHuy Nguyen <huyn@mellanox.com>
Fri, 29 Mar 2019 22:37:58 +0000 (15:37 -0700)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 2 Apr 2019 19:49:38 +0000 (12:49 -0700)
Detach mlx5_core mdev messages from pci device mdev->pdev messages and
provide a better report/debug of different mlx5 device types.

This patch does not change any functionality.

Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Signed-off-by: Vu Pham <vuhuong@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h

index b127044293b1adb52aecf41f31faf0ed367faab1..1e94ba62892f005d78111b9380f7066062ffb7c3 100644 (file)
 extern uint mlx5_core_debug_mask;
 
 #define mlx5_core_dbg(__dev, format, ...)                              \
-       dev_dbg(&(__dev)->pdev->dev, "%s:%d:(pid %d): " format,         \
+       pr_debug("%s:%s:%d:(pid %d): " format, (__dev)->priv.name,      \
                 __func__, __LINE__, current->pid,                      \
                 ##__VA_ARGS__)
 
 #define mlx5_core_dbg_once(__dev, format, ...)                         \
-       dev_dbg_once(&(__dev)->pdev->dev, "%s:%d:(pid %d): " format,    \
+       pr_debug_once("%s:%s:%d:(pid %d): " format, (__dev)->priv.name, \
                     __func__, __LINE__, current->pid,                  \
                     ##__VA_ARGS__)
 
@@ -64,28 +64,27 @@ do {                                                                        \
 } while (0)
 
 #define mlx5_core_err(__dev, format, ...)                              \
-       dev_err(&(__dev)->pdev->dev, "%s:%d:(pid %d): " format, \
+       pr_err("%s:%s:%d:(pid %d): " format, (__dev)->priv.name,        \
                __func__, __LINE__, current->pid,       \
               ##__VA_ARGS__)
 
-#define mlx5_core_err_rl(__dev, format, ...)                           \
-       dev_err_ratelimited(&(__dev)->pdev->dev,                        \
-                          "%s:%d:(pid %d): " format,                   \
-                          __func__, __LINE__, current->pid,            \
+#define mlx5_core_err_rl(__dev, format, ...)                                \
+       pr_err_ratelimited("%s:%s:%d:(pid %d): " format, (__dev)->priv.name, \
+                          __func__, __LINE__, current->pid,                 \
                           ##__VA_ARGS__)
 
 #define mlx5_core_warn(__dev, format, ...)                             \
-       dev_warn(&(__dev)->pdev->dev, "%s:%d:(pid %d): " format,        \
+       pr_warn("%s:%s:%d:(pid %d): " format, (__dev)->priv.name,       \
                 __func__, __LINE__, current->pid,                      \
                ##__VA_ARGS__)
 
 #define mlx5_core_warn_once(__dev, format, ...)                                \
-       dev_warn_once(&(__dev)->pdev->dev, "%s:%d:(pid %d): " format,   \
+       pr_warn_once("%s:%s:%d:(pid %d): " format, (__dev)->priv.name,  \
                      __func__, __LINE__, current->pid,                 \
                      ##__VA_ARGS__)
 
 #define mlx5_core_info(__dev, format, ...)                             \
-       dev_info(&(__dev)->pdev->dev, format, ##__VA_ARGS__)
+       pr_info("%s " format, (__dev)->priv.name, ##__VA_ARGS__)
 
 enum {
        MLX5_CMD_DATA, /* print command payload only */