]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx4_core: Preserve pci_dev_data after __mlx4_remove_one()
authorWei Yang <weiyang@linux.vnet.ibm.com>
Sun, 1 Jun 2014 07:24:35 +0000 (15:24 +0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 9 Apr 2015 12:13:52 +0000 (14:13 +0200)
commite63a44010451b777374f4e651abe7307b8cab90b
treedaca59e486f0b797816e3bf2e2d24565b264eafe
parente359cc96c842315dde963e7b83aae82bb4722db2
net/mlx4_core: Preserve pci_dev_data after __mlx4_remove_one()

[ Upstream commit befdf8978accecac2e0739e6b5075afc62db37fe ]

pci_match_id() just match the static pci_device_id, which may return NULL if
someone binds the driver to a device manually using
/sys/bus/pci/drivers/.../new_id.

This patch wrap up a helper function __mlx4_remove_one() which does the tear
down function but preserve the drv_data. Functions like
mlx4_pci_err_detected() and mlx4_restart_one() will call this one with out
releasing drvdata.

Fixes: 97a5221 "net/mlx4_core: pass pci_device_id.driver_data to __mlx4_init_one during reset".
CC: Bjorn Helgaas <bhelgaas@google.com>
CC: Amir Vadai <amirv@mellanox.com>
CC: Jack Morgenstein <jackm@dev.mellanox.co.il>
CC: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
Acked-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/net/ethernet/mellanox/mlx4/main.c
drivers/net/ethernet/mellanox/mlx4/mlx4.h