Skip to content

Commit d9a1dcd

Browse files
hkallweitNipaLocal
authored and
NipaLocal
committed
net: phy: assign default match function for non-PHY MDIO devices
Make mdio_device_bus_match() the default match function for non-PHY MDIO devices. Benefit is that we don't have to export this function any longer. As long as mdiodev->modalias isn't set, there's no change in behavior. mdiobus_create_device() is the only place where mdiodev->modalias gets set, but this function sets mdio_device_bus_match() as match function anyway. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NipaLocal <nipa@local>
1 parent f458f78 commit d9a1dcd

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

drivers/net/phy/mdio_bus_provider.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ static int mdiobus_create_device(struct mii_bus *bus,
152152

153153
strscpy(mdiodev->modalias, bi->modalias,
154154
sizeof(mdiodev->modalias));
155-
mdiodev->bus_match = mdio_device_bus_match;
156155
mdiodev->dev.platform_data = (void *)bi->platform_data;
157156

158157
ret = mdio_device_register(mdiodev);

drivers/net/phy/mdio_device.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ static void mdio_device_release(struct device *dev)
3535
kfree(to_mdio_device(dev));
3636
}
3737

38-
int mdio_device_bus_match(struct device *dev, const struct device_driver *drv)
38+
static int mdio_device_bus_match(struct device *dev,
39+
const struct device_driver *drv)
3940
{
4041
struct mdio_device *mdiodev = to_mdio_device(dev);
4142
const struct mdio_driver *mdiodrv = to_mdio_driver(drv);
@@ -45,7 +46,6 @@ int mdio_device_bus_match(struct device *dev, const struct device_driver *drv)
4546

4647
return strcmp(mdiodev->modalias, drv->name) == 0;
4748
}
48-
EXPORT_SYMBOL_GPL(mdio_device_bus_match);
4949

5050
struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr)
5151
{
@@ -59,6 +59,7 @@ struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr)
5959
mdiodev->dev.release = mdio_device_release;
6060
mdiodev->dev.parent = &bus->dev;
6161
mdiodev->dev.bus = &mdio_bus_type;
62+
mdiodev->bus_match = mdio_device_bus_match;
6263
mdiodev->device_free = mdio_device_free;
6364
mdiodev->device_remove = mdio_device_remove;
6465
mdiodev->bus = bus;

include/linux/mdio.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ void mdio_device_remove(struct mdio_device *mdiodev);
9595
void mdio_device_reset(struct mdio_device *mdiodev, int value);
9696
int mdio_driver_register(struct mdio_driver *drv);
9797
void mdio_driver_unregister(struct mdio_driver *drv);
98-
int mdio_device_bus_match(struct device *dev, const struct device_driver *drv);
9998

10099
static inline void mdio_device_get(struct mdio_device *mdiodev)
101100
{

0 commit comments

Comments
 (0)