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.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
d05d9eb79d
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -1153,8 +1153,6 @@ static int seville_remove(struct platform_device *pdev)
|
||||
kfree(felix->ds);
|
||||
kfree(felix);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user