Skip to content

Commit

Permalink
Merge branch 'net-dsa-remove-unnecessary-set_drvdata'
Browse files Browse the repository at this point in the history
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.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Sep 23, 2022
2 parents 304843c + 24aeeb1 commit d05d9eb
Show file tree
Hide file tree
Showing 24 changed files with 0 additions and 47 deletions.
2 changes: 0 additions & 2 deletions drivers/net/dsa/b53/b53_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,6 @@ static void b53_mdio_remove(struct mdio_device *mdiodev)
return;

b53_switch_remove(dev);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void b53_mdio_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/b53/b53_mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,6 @@ static int b53_mmap_remove(struct platform_device *pdev)
if (dev)
b53_switch_remove(dev);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/b53/b53_srab.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,6 @@ static int b53_srab_remove(struct platform_device *pdev)
b53_srab_intr_set(dev->priv, false);
b53_switch_remove(dev);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/bcm_sf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1551,8 +1551,6 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev)
if (priv->type == BCM7278_DEVICE_ID)
reset_control_assert(priv->rcdev);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/dsa_loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@ static void dsa_loop_drv_remove(struct mdio_device *mdiodev)

dsa_unregister_switch(ds);
dev_put(ps->netdev);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void dsa_loop_drv_shutdown(struct mdio_device *mdiodev)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/dsa/hirschmann/hellcreek.c
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,6 @@ static int hellcreek_remove(struct platform_device *pdev)
hellcreek_hwtstamp_free(hellcreek);
hellcreek_ptp_free(hellcreek);
dsa_unregister_switch(hellcreek->ds);
platform_set_drvdata(pdev, NULL);

return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/lan9303_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ static void lan9303_mdio_remove(struct mdio_device *mdiodev)
return;

lan9303_remove(&sw_dev->chip);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void lan9303_mdio_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/lantiq_gswip.c
Original file line number Diff line number Diff line change
Expand Up @@ -2229,8 +2229,6 @@ static int gswip_remove(struct platform_device *pdev)
for (i = 0; i < priv->num_gphy_fw; i++)
gswip_gphy_fw_remove(priv, &priv->gphy_fw[i]);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/microchip/ksz8863_smi.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ static void ksz8863_smi_remove(struct mdio_device *mdiodev)

if (dev)
ksz_switch_remove(dev);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void ksz8863_smi_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/microchip/ksz_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ static void ksz_spi_remove(struct spi_device *spi)

if (dev)
ksz_switch_remove(dev);

spi_set_drvdata(spi, NULL);
}

static void ksz_spi_shutdown(struct spi_device *spi)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/mt7530.c
Original file line number Diff line number Diff line change
Expand Up @@ -3300,8 +3300,6 @@ mt7530_remove(struct mdio_device *mdiodev)

dsa_unregister_switch(priv->ds);
mutex_destroy(&priv->reg_mutex);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void mt7530_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/mv88e6060.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,6 @@ static void mv88e6060_remove(struct mdio_device *mdiodev)
return;

dsa_unregister_switch(ds);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void mv88e6060_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/mv88e6xxx/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -7185,8 +7185,6 @@ static void mv88e6xxx_remove(struct mdio_device *mdiodev)
mv88e6xxx_g1_irq_free(chip);
else
mv88e6xxx_irq_poll_free(chip);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void mv88e6xxx_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/ocelot/felix_vsc9959.c
Original file line number Diff line number Diff line change
Expand Up @@ -2727,8 +2727,6 @@ static void felix_pci_remove(struct pci_dev *pdev)
kfree(felix);

pci_disable_device(pdev);

pci_set_drvdata(pdev, NULL);
}

static void felix_pci_shutdown(struct pci_dev *pdev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/ocelot/seville_vsc9953.c
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,6 @@ static int seville_remove(struct platform_device *pdev)
kfree(felix->ds);
kfree(felix);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/qca/ar9331.c
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,6 @@ static void ar9331_sw_remove(struct mdio_device *mdiodev)
dsa_unregister_switch(&priv->ds);

reset_control_assert(priv->sw_reset);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void ar9331_sw_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/qca/qca8k-8xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1957,8 +1957,6 @@ qca8k_sw_remove(struct mdio_device *mdiodev)
qca8k_port_set_status(priv, i, 0);

dsa_unregister_switch(priv->ds);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void qca8k_sw_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/realtek/realtek-mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ static void realtek_mdio_remove(struct mdio_device *mdiodev)
/* leave the device reset asserted */
if (priv->reset)
gpiod_set_value(priv->reset, 1);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void realtek_mdio_shutdown(struct mdio_device *mdiodev)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/realtek/realtek-smi.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,6 @@ static int realtek_smi_remove(struct platform_device *pdev)
if (priv->reset)
gpiod_set_value(priv->reset, 1);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/rzn1_a5psw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1025,8 +1025,6 @@ static int a5psw_remove(struct platform_device *pdev)
clk_disable_unprepare(a5psw->hclk);
clk_disable_unprepare(a5psw->clk);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/sja1105/sja1105_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3351,8 +3351,6 @@ static void sja1105_remove(struct spi_device *spi)
return;

dsa_unregister_switch(priv->ds);

spi_set_drvdata(spi, NULL);
}

static void sja1105_shutdown(struct spi_device *spi)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/vitesse-vsc73xx-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ static int vsc73xx_platform_remove(struct platform_device *pdev)

vsc73xx_remove(&vsc_platform->vsc);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/vitesse-vsc73xx-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ static void vsc73xx_spi_remove(struct spi_device *spi)
return;

vsc73xx_remove(&vsc_spi->vsc);

spi_set_drvdata(spi, NULL);
}

static void vsc73xx_spi_shutdown(struct spi_device *spi)
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/dsa/xrs700x/xrs700x_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ static void xrs700x_mdio_remove(struct mdio_device *mdiodev)
return;

xrs700x_switch_remove(priv);

dev_set_drvdata(&mdiodev->dev, NULL);
}

static void xrs700x_mdio_shutdown(struct mdio_device *mdiodev)
Expand Down

0 comments on commit d05d9eb

Please sign in to comment.