Messages in this thread | | | Date | Wed, 18 Oct 2023 19:14:41 +0200 | From | Oleksij Rempel <> | Subject | Re: [PATCH net-next v5 8/9] net: dsa: microchip: Refactor switch shutdown routine for WoL preparation |
| |
On Wed, Oct 18, 2023 at 01:39:12PM +0200, Oleksij Rempel wrote: > 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 <o.rempel@pengutronix.de> > Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com> > --- ... > 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); > +}
here is missing EXPORT_SYMBOL(ksz_switch_shutdown); -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
| |