can: remove unnecessary pci_set_drvdata()
Subsystems (2)
cover can: remove unnecessary pci_set_drvdata()
Since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound), the driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/net/can/c_can/c_can_pci.c | 2 -- drivers/net/can/pch_can.c | 1 - drivers/net/can/sja1000/ems_pci.c | 1 - drivers/net/can/sja1000/kvaser_pci.c | 1 - drivers/net/can/sja1000/peak_pci.c | 2 -- drivers/net/can/sja1000/plx_pci.c | 1 - 6 files changed, 8 deletions(-)
PATCH 1/3 can: c_can: 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 needed to manually clear the device driver data to NULL.
--- drivers/net/can/c_can/c_can_pci.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/can/c_can/c_can_pci.c +0 -2
@@ -160,7 +160,6 @@ static int c_can_pci_probe(struct pci_dev *pdev,return 0 ; out_free_c_can: -pci_set_drvdata (pdev,NULL );free_c_can_dev (dev); out_iounmap:pci_iounmap (pdev, addr);
@@ -181,7 +180,6 @@ static void c_can_pci_remove(struct pci_dev *pdev)unregister_c_can_dev (dev); -pci_set_drvdata (pdev,NULL );free_c_can_dev (dev);pci_iounmap (pdev, priv->base);
Signature · 1 line
1.7.10.4
PATCH 2/3 can: pch_can: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/net/can/pch_can.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/can/pch_can.c +0 -1
@@ -964,7 +964,6 @@ static void pch_can_remove(struct pci_dev *pdev)pci_disable_msi (priv->dev);pci_release_regions (pdev);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL );pch_can_reset (priv);pci_iounmap (pdev, priv->regs);free_candev (priv->ndev);
Signature · 1 line
1.7.10.4
PATCH 3/3 can: sja1000: remove unnecessary pci_set_drvdata()
In reply to Jingoo HanThe driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
--- drivers/net/can/sja1000/ems_pci.c | 1 - drivers/net/can/sja1000/kvaser_pci.c | 1 - drivers/net/can/sja1000/peak_pci.c | 2 -- drivers/net/can/sja1000/plx_pci.c | 1 - 4 files changed, 5 deletions(-)
drivers/net/can/sja1000/ems_pci.c +0 -1
@@ -207,7 +207,6 @@ static void ems_pci_del_card(struct pci_dev *pdev)kfree (card);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL ); }static void ems_pci_card_reset (struct ems_pci_card *card)
drivers/net/can/sja1000/kvaser_pci.c +0 -1
@@ -387,7 +387,6 @@ static void kvaser_pci_remove_one(struct pci_dev *pdev)pci_release_regions (pdev);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL ); }static struct pci_driver kvaser_pci_driver = {
drivers/net/can/sja1000/peak_pci.c +0 -2
@@ -744,8 +744,6 @@ static void peak_pci_remove(struct pci_dev *pdev)pci_iounmap (pdev, cfg_base);pci_release_regions (pdev);pci_disable_device (pdev); - -pci_set_drvdata (pdev,NULL ); }static struct pci_driver peak_pci_driver = {
drivers/net/can/sja1000/plx_pci.c +0 -1
@@ -477,7 +477,6 @@ static void plx_pci_del_card(struct pci_dev *pdev)kfree (card);pci_disable_device (pdev); -pci_set_drvdata (pdev,NULL ); }/*
Signature · 1 line
1.7.10.4
Marc Kleine-Budde
maintainerQuoted 5 lines · Jingoo Han
Since commit
0998d0631001288a5974afc0b2a5f568bcdecb4d(device-core: Ensure drvdata = NULL when no driver is bound), the driver core clears the driver data to NULL afterdevice_releaseor on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.
Tnx, all applied to net-next/testing. The series will be included in the next pull request to David Miller.
regards,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |