Skip to contentSkip to conversation

net: dsa: microchip: remove unnecessary spi_set_drvdata()

PATCH In review Yang Yingliang 2 participants 5 messages Sep 13, 2022 – Sep 21, 2022

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 net: dsa: microchip: remove unnecessary spi_set_drvdata()

Remove unnecessary spi_set_drvdata() in ksz_spi_remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove().

---
 drivers/net/dsa/microchip/ksz_spi.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/dsa/microchip/ksz_spi.c +0 -2
index 82e2352f55fa..1b6ab891b986 100644
@@ -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)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/3 net: dsa: sja1105: remove unnecessary spi_set_drvdata()

Remove unnecessary spi_set_drvdata() in sja1105_remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove().

---
 drivers/net/dsa/sja1105/sja1105_main.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/dsa/sja1105/sja1105_main.c +0 -2
index b03d0d0c3dbf..412666111b0c 100644
@@ -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)
Signature · 1 line
2.25.1
#2 lore raw

PATCH 3/3 net: dsa: vitesse-vsc73xx: remove unnecessary spi_set_drvdata()

In reply to Yang Yingliang

Remove unnecessary spi_set_drvdata() in vsc73xx_spi_remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove().

---
 drivers/net/dsa/vitesse-vsc73xx-spi.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/dsa/vitesse-vsc73xx-spi.c +0 -2
index 97a92e6da60d..85b9a0f51dd8 100644
@@ -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)
Signature · 1 line
2.25.1
maintainer
#3 lore raw
In reply to Yang Yingliang
Quoted 6 lines · Yang Yingliang

Remove unnecessary spi_set_drvdata() in ksz_spi_remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove().

---

I would like all drivers in drivers/net/dsa/ to follow the same convention, which they currently do. They all call .*_set_drvdata.*NULL from ->remove(), why just patch the spi_set_drvdata() calls?

#4 lore raw

Hi Vladimir,

Quoted 10 lines · Vladimir Oltean
Quoted 6 lines · Yang Yingliang

Remove unnecessary spi_set_drvdata() in ksz_spi_remove(), the driver_data will be set to NULL in device_unbind_cleanup() after calling ->remove().

---

I would like all drivers in drivers/net/dsa/ to follow the same convention, which they currently do. They all call .*_set_drvdata.*NULL from ->remove(), why just patch the spi_set_drvdata() calls?

Yes, it's right, all the set_drvdata functions in ->remove() can be removed. I will send a v2 to remove all this calling.

Thanks,
Yang

Quoted 1 line

.