From 8cc464c334553e571d002081ba0089edb9afc1e6 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 22 Feb 2025 21:33:19 +0100 Subject: net: miiphybb: Drop bb_miiphy_init() and .init callback The .init callback is not called by any function, drop it. There are no more users of the init callback, drop the entire mechanism. Reviewed-by: Paul Barker Signed-off-by: Marek Vasut --- include/miiphy.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'include/miiphy.h') diff --git a/include/miiphy.h b/include/miiphy.h index 1e6c7041fdc..0464f5dc219 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -65,7 +65,6 @@ void mdio_list_devices(void); struct bb_miiphy_bus { char name[MDIO_NAME_LEN]; - int (*init)(struct bb_miiphy_bus *bus); int (*mdio_active)(struct bb_miiphy_bus *bus); int (*mdio_tristate)(struct bb_miiphy_bus *bus); int (*set_mdio)(struct bb_miiphy_bus *bus, int v); @@ -78,15 +77,6 @@ struct bb_miiphy_bus { extern struct bb_miiphy_bus bb_miiphy_buses[]; extern int bb_miiphy_buses_num; -/** - * bb_miiphy_init() - Initialize bit-banged MII bus driver - * - * It is called during the generic post-relocation init sequence. - * - * Return: 0 if OK - */ -int bb_miiphy_init(void); - int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg); int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg, u16 value); -- cgit v1.2.3 From f15919436bea3336f2dcb86f564180aceccc9c47 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 22 Feb 2025 21:33:22 +0100 Subject: net: miiphy: Introduce mdio_init() Introduce mdio_init() split off from mdio_alloc(), which is used to initialize already allocated struct mii_dev. Reviewed-by: Paul Barker Signed-off-by: Marek Vasut --- include/miiphy.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/miiphy.h') diff --git a/include/miiphy.h b/include/miiphy.h index 0464f5dc219..40eb14669b8 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -44,6 +44,7 @@ struct phy_device *mdio_phydev_for_ethname(const char *devname); void miiphy_listdev(void); +void mdio_init(struct mii_dev *bus); struct mii_dev *mdio_alloc(void); void mdio_free(struct mii_dev *bus); int mdio_register(struct mii_dev *bus); -- cgit v1.2.3 From 1b879bf5552bce022350bb96d616e5b2838af952 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 22 Feb 2025 21:33:23 +0100 Subject: net: miiphybb: Introduce bb_miiphy_alloc()/bb_miiphy_free() wrappers Introduce bb_miiphy_alloc()/bb_miiphy_free() wrappers to allocate and free struct bb_miiphy_bus. Make struct bb_miiphy_bus wrap struct mii_dev, which will become useful later in bb_miiphy_bus accessors, which would be able to access struct bb_miiphy_bus using container_of, even if the PHY stack only passes in the inner struct mii_dev . Reviewed-by: Paul Barker Signed-off-by: Marek Vasut --- include/miiphy.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/miiphy.h') diff --git a/include/miiphy.h b/include/miiphy.h index 40eb14669b8..42300ee5386 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -73,11 +73,15 @@ struct bb_miiphy_bus { int (*set_mdc)(struct bb_miiphy_bus *bus, int v); int (*delay)(struct bb_miiphy_bus *bus); void *priv; + struct mii_dev mii; }; extern struct bb_miiphy_bus bb_miiphy_buses[]; extern int bb_miiphy_buses_num; +struct bb_miiphy_bus *bb_miiphy_alloc(void); +void bb_miiphy_free(struct bb_miiphy_bus *bus); + int bb_miiphy_read(struct mii_dev *miidev, int addr, int devad, int reg); int bb_miiphy_write(struct mii_dev *miidev, int addr, int devad, int reg, u16 value); -- cgit v1.2.3 From a23f9a786b010177839d6fe9f67c717f17f74368 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 22 Feb 2025 21:33:29 +0100 Subject: net: miiphybb: Drop name field from struct bb_miiphy_bus The struct bb_miiphy_bus embeds struct struct mii_dev, which already contains one copy of name field. Drop the duplicate top level copy of name field. The a38x code does static assignment of disparate names, use snprintf(...) to fill in matching name in probe to avoid any breakage. Reviewed-by: Paul Barker Signed-off-by: Marek Vasut --- include/miiphy.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/miiphy.h') diff --git a/include/miiphy.h b/include/miiphy.h index 42300ee5386..efeff8ae70b 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -65,7 +65,6 @@ void mdio_list_devices(void); #define BB_MII_DEVNAME "bb_miiphy" struct bb_miiphy_bus { - char name[MDIO_NAME_LEN]; int (*mdio_active)(struct bb_miiphy_bus *bus); int (*mdio_tristate)(struct bb_miiphy_bus *bus); int (*set_mdio)(struct bb_miiphy_bus *bus, int v); -- cgit v1.2.3 From 4e6fed49becc7e8d9639966fd34695583192a3ee Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 22 Feb 2025 21:33:33 +0100 Subject: net: miiphybb: Drop bb_miiphy_buses and bb_miiphy_buses_num Neither bb_miiphy_buses nor bb_miiphy_buses_num are used anymore. Drop both of them. Reviewed-by: Paul Barker Signed-off-by: Marek Vasut --- include/miiphy.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/miiphy.h') diff --git a/include/miiphy.h b/include/miiphy.h index efeff8ae70b..b879fd16ae3 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -75,9 +75,6 @@ struct bb_miiphy_bus { struct mii_dev mii; }; -extern struct bb_miiphy_bus bb_miiphy_buses[]; -extern int bb_miiphy_buses_num; - struct bb_miiphy_bus *bb_miiphy_alloc(void); void bb_miiphy_free(struct bb_miiphy_bus *bus); -- cgit v1.2.3