Commit cce11ac1 authored by Wei Yang's avatar Wei Yang Committed by Ben Hutchings

mlx4_core: Stash PCI ID driver_data in mlx4_priv structure

[ No upstream commit, this is a cherry picked backport enabler. ]

That way we can check flags later on, when we've finished with the
pci_device_id structure.

This is a backport.
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent fe33a3ee
...@@ -1220,7 +1220,7 @@ static void mlx4_clear_steering(struct mlx4_dev *dev) ...@@ -1220,7 +1220,7 @@ static void mlx4_clear_steering(struct mlx4_dev *dev)
kfree(priv->steer); kfree(priv->steer);
} }
static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) static int __mlx4_init_one(struct pci_dev *pdev, int pci_dev_data)
{ {
struct mlx4_priv *priv; struct mlx4_priv *priv;
struct mlx4_dev *dev; struct mlx4_dev *dev;
...@@ -1362,6 +1362,7 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1362,6 +1362,7 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
mlx4_sense_init(dev); mlx4_sense_init(dev);
mlx4_start_sense(dev); mlx4_start_sense(dev);
priv->pci_dev_data = pci_dev_data;
pci_set_drvdata(pdev, dev); pci_set_drvdata(pdev, dev);
return 0; return 0;
...@@ -1414,7 +1415,7 @@ static int __devinit mlx4_init_one(struct pci_dev *pdev, ...@@ -1414,7 +1415,7 @@ static int __devinit mlx4_init_one(struct pci_dev *pdev,
{ {
printk_once(KERN_INFO "%s", mlx4_version); printk_once(KERN_INFO "%s", mlx4_version);
return __mlx4_init_one(pdev, id); return __mlx4_init_one(pdev, id->driver_data);
} }
static void mlx4_remove_one(struct pci_dev *pdev) static void mlx4_remove_one(struct pci_dev *pdev)
...@@ -1463,8 +1464,13 @@ static void mlx4_remove_one(struct pci_dev *pdev) ...@@ -1463,8 +1464,13 @@ static void mlx4_remove_one(struct pci_dev *pdev)
int mlx4_restart_one(struct pci_dev *pdev) int mlx4_restart_one(struct pci_dev *pdev)
{ {
struct mlx4_dev *dev = pci_get_drvdata(pdev);
struct mlx4_priv *priv = mlx4_priv(dev);
int pci_dev_data;
pci_dev_data = priv->pci_dev_data;
mlx4_remove_one(pdev); mlx4_remove_one(pdev);
return __mlx4_init_one(pdev, NULL); return __mlx4_init_one(pdev, pci_dev_data);
} }
static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = { static DEFINE_PCI_DEVICE_TABLE(mlx4_pci_table) = {
......
...@@ -328,6 +328,8 @@ struct mlx4_priv { ...@@ -328,6 +328,8 @@ struct mlx4_priv {
struct list_head ctx_list; struct list_head ctx_list;
spinlock_t ctx_lock; spinlock_t ctx_lock;
int pci_dev_data;
struct list_head pgdir_list; struct list_head pgdir_list;
struct mutex pgdir_mutex; struct mutex pgdir_mutex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment