From: Zhu Yanjun Date: Tue, 15 Aug 2017 06:33:05 +0000 (-0400) Subject: mlx4: remove unnecessary pci_set_drvdata() X-Git-Tag: v4.14-rc1~130^2~248 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e084a8b89c173d7b37e886b277b6d3e05669259a;p=platform%2Fkernel%2Flinux-rpi3.git mlx4: remove unnecessary pci_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not necessary to manually clear the device driver data to NULL. Cc: Joe Jin Cc: Junxiao Bi Signed-off-by: Zhu Yanjun Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 09b9bc1..df9b0ef 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -3782,7 +3782,6 @@ err_release_regions: err_disable_pdev: mlx4_pci_disable_device(&priv->dev); - pci_set_drvdata(pdev, NULL); return err; } @@ -3997,7 +3996,6 @@ static void mlx4_remove_one(struct pci_dev *pdev) devlink_unregister(devlink); kfree(dev->persist); devlink_free(devlink); - pci_set_drvdata(pdev, NULL); } static int restore_current_port_types(struct mlx4_dev *dev,