summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii/nsgphy.c
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2006-12-02 15:32:34 +0000
committermarius <marius@FreeBSD.org>2006-12-02 15:32:34 +0000
commit923629baa0e29adb56de97ed5d8fd54e71cd3b49 (patch)
tree25749fe19f52ff6e7be4f3431382ac173c7c08fc /sys/dev/mii/nsgphy.c
parent2db40ccfce7ea070a08fa10f3969ee21f4d49779 (diff)
downloadFreeBSD-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/nsgphy.c')
-rw-r--r--sys/dev/mii/nsgphy.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c
index 8748b66..d7db537 100644
--- a/sys/dev/mii/nsgphy.c
+++ b/sys/dev/mii/nsgphy.c
@@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <sys/bus.h>
-
#include <net/if.h>
#include <net/if_media.h>
@@ -93,13 +92,12 @@ static driver_t nsgphy_driver = {
sizeof(struct mii_softc)
};
-
DRIVER_MODULE(nsgphy, miibus, nsgphy_driver, nsgphy_devclass, 0, 0);
static int nsgphy_service(struct mii_softc *, struct mii_data *,int);
static void nsgphy_status(struct mii_softc *);
-const struct mii_phydesc gphyters[] = {
+static const struct mii_phydesc nsgphys[] = {
MII_PHY_DESC(NATSEMI, DP83861),
MII_PHY_DESC(NATSEMI, DP83891),
MII_PHY_END
@@ -108,17 +106,8 @@ const struct mii_phydesc gphyters[] = {
static int
nsgphy_probe(device_t dev)
{
- struct mii_attach_args *ma;
- const struct mii_phydesc *mpd;
-
- ma = device_get_ivars(dev);
- mpd = mii_phy_match(ma, gphyters);
- if (mpd != NULL) {
- device_set_desc(dev, mpd->mpd_name);
- return (BUS_PROBE_DEFAULT);
- }
- return (ENXIO);
+ return (mii_phy_dev_probe(dev, nsgphys, BUS_PROBE_DEFAULT));
}
static int
OpenPOWER on IntegriCloud