Commit d05d9eb7 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'net-dsa-remove-unnecessary-set_drvdata'

Yang Yingliang says:

====================
net: dsa: remove unnecessary set_drvdata()

In this patch set, I removed all set_drvdata(NULL) functions
in ->remove() in drivers/net/dsa/.

The driver_data will be set to NULL in device_unbind_cleanup()
after calling ->remove(), so all set_drvdata(NULL) functions
in ->remove() is redundant, they can be removed.

Here is the previous patch set:
https://lore.kernel.org/netdev/facfc855-d082-cc1c-a0bc-027f562a2f45@huawei.com/T/
====================

Link: https://lore.kernel.org/r/20220921140524.3831101-1-yangyingliang@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 304843c7 24aeeb10
...@@ -356,8 +356,6 @@ static void b53_mdio_remove(struct mdio_device *mdiodev) ...@@ -356,8 +356,6 @@ static void b53_mdio_remove(struct mdio_device *mdiodev)
return; return;
b53_switch_remove(dev); b53_switch_remove(dev);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void b53_mdio_shutdown(struct mdio_device *mdiodev) static void b53_mdio_shutdown(struct mdio_device *mdiodev)
......
...@@ -316,8 +316,6 @@ static int b53_mmap_remove(struct platform_device *pdev) ...@@ -316,8 +316,6 @@ static int b53_mmap_remove(struct platform_device *pdev)
if (dev) if (dev)
b53_switch_remove(dev); b53_switch_remove(dev);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -667,8 +667,6 @@ static int b53_srab_remove(struct platform_device *pdev) ...@@ -667,8 +667,6 @@ static int b53_srab_remove(struct platform_device *pdev)
b53_srab_intr_set(dev->priv, false); b53_srab_intr_set(dev->priv, false);
b53_switch_remove(dev); b53_switch_remove(dev);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -1551,8 +1551,6 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev) ...@@ -1551,8 +1551,6 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev)
if (priv->type == BCM7278_DEVICE_ID) if (priv->type == BCM7278_DEVICE_ID)
reset_control_assert(priv->rcdev); reset_control_assert(priv->rcdev);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -351,8 +351,6 @@ static void dsa_loop_drv_remove(struct mdio_device *mdiodev) ...@@ -351,8 +351,6 @@ static void dsa_loop_drv_remove(struct mdio_device *mdiodev)
dsa_unregister_switch(ds); dsa_unregister_switch(ds);
dev_put(ps->netdev); dev_put(ps->netdev);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void dsa_loop_drv_shutdown(struct mdio_device *mdiodev) static void dsa_loop_drv_shutdown(struct mdio_device *mdiodev)
......
...@@ -1996,7 +1996,6 @@ static int hellcreek_remove(struct platform_device *pdev) ...@@ -1996,7 +1996,6 @@ static int hellcreek_remove(struct platform_device *pdev)
hellcreek_hwtstamp_free(hellcreek); hellcreek_hwtstamp_free(hellcreek);
hellcreek_ptp_free(hellcreek); hellcreek_ptp_free(hellcreek);
dsa_unregister_switch(hellcreek->ds); dsa_unregister_switch(hellcreek->ds);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -138,8 +138,6 @@ static void lan9303_mdio_remove(struct mdio_device *mdiodev) ...@@ -138,8 +138,6 @@ static void lan9303_mdio_remove(struct mdio_device *mdiodev)
return; return;
lan9303_remove(&sw_dev->chip); lan9303_remove(&sw_dev->chip);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void lan9303_mdio_shutdown(struct mdio_device *mdiodev) static void lan9303_mdio_shutdown(struct mdio_device *mdiodev)
......
...@@ -2229,8 +2229,6 @@ static int gswip_remove(struct platform_device *pdev) ...@@ -2229,8 +2229,6 @@ static int gswip_remove(struct platform_device *pdev)
for (i = 0; i < priv->num_gphy_fw; i++) for (i = 0; i < priv->num_gphy_fw; i++)
gswip_gphy_fw_remove(priv, &priv->gphy_fw[i]); gswip_gphy_fw_remove(priv, &priv->gphy_fw[i]);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -180,8 +180,6 @@ static void ksz8863_smi_remove(struct mdio_device *mdiodev) ...@@ -180,8 +180,6 @@ static void ksz8863_smi_remove(struct mdio_device *mdiodev)
if (dev) if (dev)
ksz_switch_remove(dev); ksz_switch_remove(dev);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void ksz8863_smi_shutdown(struct mdio_device *mdiodev) static void ksz8863_smi_shutdown(struct mdio_device *mdiodev)
......
...@@ -107,8 +107,6 @@ static void ksz_spi_remove(struct spi_device *spi) ...@@ -107,8 +107,6 @@ static void ksz_spi_remove(struct spi_device *spi)
if (dev) if (dev)
ksz_switch_remove(dev); ksz_switch_remove(dev);
spi_set_drvdata(spi, NULL);
} }
static void ksz_spi_shutdown(struct spi_device *spi) static void ksz_spi_shutdown(struct spi_device *spi)
......
...@@ -3300,8 +3300,6 @@ mt7530_remove(struct mdio_device *mdiodev) ...@@ -3300,8 +3300,6 @@ mt7530_remove(struct mdio_device *mdiodev)
dsa_unregister_switch(priv->ds); dsa_unregister_switch(priv->ds);
mutex_destroy(&priv->reg_mutex); mutex_destroy(&priv->reg_mutex);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void mt7530_shutdown(struct mdio_device *mdiodev) static void mt7530_shutdown(struct mdio_device *mdiodev)
......
...@@ -297,8 +297,6 @@ static void mv88e6060_remove(struct mdio_device *mdiodev) ...@@ -297,8 +297,6 @@ static void mv88e6060_remove(struct mdio_device *mdiodev)
return; return;
dsa_unregister_switch(ds); dsa_unregister_switch(ds);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void mv88e6060_shutdown(struct mdio_device *mdiodev) static void mv88e6060_shutdown(struct mdio_device *mdiodev)
......
...@@ -7185,8 +7185,6 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev) ...@@ -7185,8 +7185,6 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev)
mv88e6xxx_g1_irq_free(chip); mv88e6xxx_g1_irq_free(chip);
else else
mv88e6xxx_irq_poll_free(chip); mv88e6xxx_irq_poll_free(chip);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void mv88e6xxx_shutdown(struct mdio_device *mdiodev) static void mv88e6xxx_shutdown(struct mdio_device *mdiodev)
......
...@@ -2727,8 +2727,6 @@ static void felix_pci_remove(struct pci_dev *pdev) ...@@ -2727,8 +2727,6 @@ static void felix_pci_remove(struct pci_dev *pdev)
kfree(felix); kfree(felix);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
} }
static void felix_pci_shutdown(struct pci_dev *pdev) static void felix_pci_shutdown(struct pci_dev *pdev)
......
...@@ -1153,8 +1153,6 @@ static int seville_remove(struct platform_device *pdev) ...@@ -1153,8 +1153,6 @@ static int seville_remove(struct platform_device *pdev)
kfree(felix->ds); kfree(felix->ds);
kfree(felix); kfree(felix);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -1099,8 +1099,6 @@ static void ar9331_sw_remove(struct mdio_device *mdiodev) ...@@ -1099,8 +1099,6 @@ static void ar9331_sw_remove(struct mdio_device *mdiodev)
dsa_unregister_switch(&priv->ds); dsa_unregister_switch(&priv->ds);
reset_control_assert(priv->sw_reset); reset_control_assert(priv->sw_reset);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void ar9331_sw_shutdown(struct mdio_device *mdiodev) static void ar9331_sw_shutdown(struct mdio_device *mdiodev)
......
...@@ -1957,8 +1957,6 @@ qca8k_sw_remove(struct mdio_device *mdiodev) ...@@ -1957,8 +1957,6 @@ qca8k_sw_remove(struct mdio_device *mdiodev)
qca8k_port_set_status(priv, i, 0); qca8k_port_set_status(priv, i, 0);
dsa_unregister_switch(priv->ds); dsa_unregister_switch(priv->ds);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void qca8k_sw_shutdown(struct mdio_device *mdiodev) static void qca8k_sw_shutdown(struct mdio_device *mdiodev)
......
...@@ -245,8 +245,6 @@ static void realtek_mdio_remove(struct mdio_device *mdiodev) ...@@ -245,8 +245,6 @@ static void realtek_mdio_remove(struct mdio_device *mdiodev)
/* leave the device reset asserted */ /* leave the device reset asserted */
if (priv->reset) if (priv->reset)
gpiod_set_value(priv->reset, 1); gpiod_set_value(priv->reset, 1);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void realtek_mdio_shutdown(struct mdio_device *mdiodev) static void realtek_mdio_shutdown(struct mdio_device *mdiodev)
......
...@@ -522,8 +522,6 @@ static int realtek_smi_remove(struct platform_device *pdev) ...@@ -522,8 +522,6 @@ static int realtek_smi_remove(struct platform_device *pdev)
if (priv->reset) if (priv->reset)
gpiod_set_value(priv->reset, 1); gpiod_set_value(priv->reset, 1);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -1025,8 +1025,6 @@ static int a5psw_remove(struct platform_device *pdev) ...@@ -1025,8 +1025,6 @@ static int a5psw_remove(struct platform_device *pdev)
clk_disable_unprepare(a5psw->hclk); clk_disable_unprepare(a5psw->hclk);
clk_disable_unprepare(a5psw->clk); clk_disable_unprepare(a5psw->clk);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -3351,8 +3351,6 @@ static void sja1105_remove(struct spi_device *spi) ...@@ -3351,8 +3351,6 @@ static void sja1105_remove(struct spi_device *spi)
return; return;
dsa_unregister_switch(priv->ds); dsa_unregister_switch(priv->ds);
spi_set_drvdata(spi, NULL);
} }
static void sja1105_shutdown(struct spi_device *spi) static void sja1105_shutdown(struct spi_device *spi)
......
...@@ -121,8 +121,6 @@ static int vsc73xx_platform_remove(struct platform_device *pdev) ...@@ -121,8 +121,6 @@ static int vsc73xx_platform_remove(struct platform_device *pdev)
vsc73xx_remove(&vsc_platform->vsc); vsc73xx_remove(&vsc_platform->vsc);
platform_set_drvdata(pdev, NULL);
return 0; return 0;
} }
......
...@@ -167,8 +167,6 @@ static void vsc73xx_spi_remove(struct spi_device *spi) ...@@ -167,8 +167,6 @@ static void vsc73xx_spi_remove(struct spi_device *spi)
return; return;
vsc73xx_remove(&vsc_spi->vsc); vsc73xx_remove(&vsc_spi->vsc);
spi_set_drvdata(spi, NULL);
} }
static void vsc73xx_spi_shutdown(struct spi_device *spi) static void vsc73xx_spi_shutdown(struct spi_device *spi)
......
...@@ -140,8 +140,6 @@ static void xrs700x_mdio_remove(struct mdio_device *mdiodev) ...@@ -140,8 +140,6 @@ static void xrs700x_mdio_remove(struct mdio_device *mdiodev)
return; return;
xrs700x_switch_remove(priv); xrs700x_switch_remove(priv);
dev_set_drvdata(&mdiodev->dev, NULL);
} }
static void xrs700x_mdio_shutdown(struct mdio_device *mdiodev) static void xrs700x_mdio_shutdown(struct mdio_device *mdiodev)
......
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