if (!dev)
                return;
 
-       if (dev->dev_ops->reset)
-               dev->dev_ops->reset(dev);
-
-       dsa_switch_shutdown(dev->ds);
+       ksz_switch_shutdown(dev);
 
        i2c_set_clientdata(i2c, NULL);
 }
 
 }
 EXPORT_SYMBOL(ksz_switch_alloc);
 
+/**
+ * ksz_switch_shutdown - Shutdown routine for the switch device.
+ * @dev: The switch device structure.
+ *
+ * This function is responsible for initiating a shutdown sequence for the
+ * switch device. It invokes the reset operation defined in the device
+ * operations, if available, to reset the switch. Subsequently, it calls the
+ * DSA framework's shutdown function to ensure a proper shutdown of the DSA
+ * switch.
+ */
+void ksz_switch_shutdown(struct ksz_device *dev)
+{
+       if (dev->dev_ops->reset)
+               dev->dev_ops->reset(dev);
+
+       dsa_switch_shutdown(dev->ds);
+}
+EXPORT_SYMBOL(ksz_switch_shutdown);
+
 static void ksz_parse_rgmii_delay(struct ksz_device *dev, int port_num,
                                  struct device_node *port_dn)
 {
 
 int ksz_switch_macaddr_get(struct dsa_switch *ds, int port,
                           struct netlink_ext_ack *extack);
 void ksz_switch_macaddr_put(struct dsa_switch *ds);
+void ksz_switch_shutdown(struct ksz_device *dev);
 
 /* Common register access functions */
 static inline struct regmap *ksz_regmap_8(struct ksz_device *dev)
 
        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);
 }