mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 19:14:35 -04:00
Currently we have a single dsa_switch_ops for 4 very distinct families of switches, and many dsa_switch_ops methods are simply a dispatches through ksz_dev_ops. That creates an avoidable level of indirection. As a preparation for removing that indirection layer, create a separate dsa_switch_ops structure wherever we have a ksz_dev_ops. These structures are not yet used - ksz_switch_ops from ksz_common.c still is. However, this reduces the noise from subsequent changes. All new dsa_switch_ops are exact copies of ksz_switch_ops. But we need to export function prototypes from ksz_common.c so that they are callable from individual drivers. Note that "individual drivers" are not actual separate kernel modules. All of ksz8.c, ksz9477.c and lan937x_main.c are part of the same ksz_switch.ko. Only the "register interface" drivers are different modules (ksz9477_i2c.o for I2C, ksz_spi.o for SPI, ksz8863_smi.o for MDIO). So we don't need to export any symbol. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com> Link: https://patch.msgid.link/20260505-clean-ksz-driver-v1-6-05d70fa42461@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
25 lines
722 B
C
25 lines
722 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Microchip KSZ8XXX series register access
|
|
*
|
|
* Copyright (C) 2020 Pengutronix, Michael Grzeschik <kernel@pengutronix.de>
|
|
*/
|
|
|
|
#ifndef __KSZ8XXX_H
|
|
#define __KSZ8XXX_H
|
|
|
|
#include <linux/types.h>
|
|
#include <net/dsa.h>
|
|
#include "ksz_common.h"
|
|
|
|
extern const struct ksz_dev_ops ksz8463_dev_ops;
|
|
extern const struct ksz_dev_ops ksz87xx_dev_ops;
|
|
extern const struct ksz_dev_ops ksz88xx_dev_ops;
|
|
extern const struct phylink_mac_ops ksz88x3_phylink_mac_ops;
|
|
extern const struct phylink_mac_ops ksz8_phylink_mac_ops;
|
|
extern const struct dsa_switch_ops ksz8463_switch_ops;
|
|
extern const struct dsa_switch_ops ksz87xx_switch_ops;
|
|
extern const struct dsa_switch_ops ksz88xx_switch_ops;
|
|
|
|
#endif
|