diff options
author | marius <marius@FreeBSD.org> | 2006-12-02 15:32:34 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2006-12-02 15:32:34 +0000 |
commit | 923629baa0e29adb56de97ed5d8fd54e71cd3b49 (patch) | |
tree | 25749fe19f52ff6e7be4f3431382ac173c7c08fc /sys/dev/mii/ip1000phy.c | |
parent | 2db40ccfce7ea070a08fa10f3969ee21f4d49779 (diff) | |
download | FreeBSD-src-923629baa0e29adb56de97ed5d8fd54e71cd3b49.zip FreeBSD-src-923629baa0e29adb56de97ed5d8fd54e71cd3b49.tar.gz |
Add a helper function mii_phy_dev_probe(), which wraps around the
mii_phy_match() API and takes care of the PHY device probe based on
the struct mii_phydesc array and the match return value provided.
Convert PHY drivers to take advantage of mii_phy_dev_probe(),
converting drivers to provide a mii_phydesc table in the first
place where necessary.
Reviewed by: yongari
MFC after: 2 weeks
Diffstat (limited to 'sys/dev/mii/ip1000phy.c')
-rw-r--r-- | sys/dev/mii/ip1000phy.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/dev/mii/ip1000phy.c b/sys/dev/mii/ip1000phy.c index 5b8e577..73f0ca2 100644 --- a/sys/dev/mii/ip1000phy.c +++ b/sys/dev/mii/ip1000phy.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include <sys/socket.h> #include <sys/bus.h> - #include <net/if.h> #include <net/if_media.h> @@ -89,17 +88,8 @@ static const struct mii_phydesc ip1000phys[] = { static int ip1000phy_probe(device_t dev) { - struct mii_attach_args *ma; - const struct mii_phydesc *mpd; - - ma = device_get_ivars(dev); - mpd = mii_phy_match(ma, ip1000phys); - if (mpd != NULL) { - device_set_desc(dev, mpd->mpd_name); - return (BUS_PROBE_DEFAULT); - } - return (ENXIO); + return (mii_phy_dev_probe(dev, ip1000phys, BUS_PROBE_DEFAULT)); } static int @@ -237,7 +227,7 @@ ip1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) PHY_WRITE(sc, IP1000PHY_MII_BMCR, speed); /* - * When settning the link manually, one side must + * When setting the link manually, one side must * be the master and the other the slave. However * ifmedia doesn't give us a good way to specify * this, so we fake it by using one of the LINK |