aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/microchip/ksz_spi.c
diff options
context:
space:
mode:
authorOleksij Rempel <[email protected]>2023-10-26 05:10:50 +0000
committerJakub Kicinski <[email protected]>2023-10-27 21:43:53 +0000
commit77c819cb493acf04bcbb52411debc4ef044429b2 (patch)
treef7ae7d6b7399b5723717d0da63077e20f8eb49e0 /drivers/net/dsa/microchip/ksz_spi.c
parentnet: dsa: microchip: Add error handling for ksz_switch_macaddr_get() (diff)
downloadkernel-77c819cb493acf04bcbb52411debc4ef044429b2.tar.gz
kernel-77c819cb493acf04bcbb52411debc4ef044429b2.zip
net: dsa: microchip: Refactor switch shutdown routine for WoL preparation
Centralize the switch shutdown routine in a dedicated function, ksz_switch_shutdown(), to enhance code maintainability and reduce redundancy. This change abstracts the common shutdown operations previously duplicated in ksz9477_i2c_shutdown() and ksz_spi_shutdown(). This refactoring is a preparatory step for an upcoming patch to avoid reset on shutdown if Wake-on-LAN (WoL) is enabled. Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Vladimir Oltean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_spi.c')
-rw-r--r--drivers/net/dsa/microchip/ksz_spi.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/dsa/microchip/ksz_spi.c b/drivers/net/dsa/microchip/ksz_spi.c
index 279338451621..6f6d878e742c 100644
--- a/drivers/net/dsa/microchip/ksz_spi.c
+++ b/drivers/net/dsa/microchip/ksz_spi.c
@@ -114,10 +114,7 @@ static void ksz_spi_shutdown(struct spi_device *spi)
if (!dev)
return;
- if (dev->dev_ops->reset)
- dev->dev_ops->reset(dev);
-
- dsa_switch_shutdown(dev->ds);
+ ksz_switch_shutdown(dev);
spi_set_drvdata(spi, NULL);
}