mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 05:41:55 +00:00
d0281a56b0
mdio-boardinfo contains code that is helpful for platforms to register specific MDIO bus devices independent of how CONFIG_MDIO_DEVICE or CONFIG_PHYLIB will be selected (modular or built-in). In order to make that possible, let's do the following: - descend into drivers/net/phy/ unconditionally - make mdiobus_setup_mdiodev_from_board_info() take a callback argument which allows us not to expose the internal MDIO board info list and mutex, yet maintain the logic within the same file - relocate the code that creates a MDIO device into drivers/net/phy/mdio_bus.c - build mdio-boardinfo.o into the kernel as soon as MDIO_DEVICE is defined (y or m) Fixes:90eff9096c
("net: phy: Allow splitting MDIO bus/device support from PHYs") Fixes:648ea01340
("net: phy: Allow pre-declaration of MDIO devices") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Tested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
23 lines
470 B
C
23 lines
470 B
C
/*
|
|
* mdio-boardinfo.h - board info interface internal to the mdio_bus
|
|
* component
|
|
*/
|
|
|
|
#ifndef __MDIO_BOARD_INFO_H
|
|
#define __MDIO_BOARD_INFO_H
|
|
|
|
#include <linux/phy.h>
|
|
#include <linux/mutex.h>
|
|
|
|
struct mdio_board_entry {
|
|
struct list_head list;
|
|
struct mdio_board_info board_info;
|
|
};
|
|
|
|
void mdiobus_setup_mdiodev_from_board_info(struct mii_bus *bus,
|
|
int (*cb)
|
|
(struct mii_bus *bus,
|
|
struct mdio_board_info *bi));
|
|
|
|
#endif /* __MDIO_BOARD_INFO_H */
|