X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fnet%2Fphy%2Fphy_device.c;fp=drivers%2Fnet%2Fphy%2Fphy_device.c;h=7da0e3dd5fe3ee44c5830761a77f7a1979e4a203;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=2d1ecfdc80dbecbc5e345d4524803ecf49bba114;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 2d1ecfdc8..7da0e3dd5 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -14,6 +14,7 @@ * option) any later version. * */ +#include #include #include #include @@ -45,35 +46,6 @@ static struct phy_driver genphy_driver; extern int mdio_bus_init(void); extern void mdio_bus_exit(void); -struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id) -{ - struct phy_device *dev; - /* We allocate the device, and initialize the - * default values */ - dev = kcalloc(1, sizeof(*dev), GFP_KERNEL); - - if (NULL == dev) - return (struct phy_device*) PTR_ERR((void*)-ENOMEM); - - dev->speed = 0; - dev->duplex = -1; - dev->pause = dev->asym_pause = 0; - dev->link = 1; - - dev->autoneg = AUTONEG_ENABLE; - - dev->addr = addr; - dev->phy_id = phy_id; - dev->bus = bus; - - dev->state = PHY_DOWN; - - spin_lock_init(&dev->lock); - - return dev; -} -EXPORT_SYMBOL(phy_device_create); - /* get_phy_device * * description: Reads the ID registers of the PHY at addr on the @@ -107,7 +79,27 @@ struct phy_device * get_phy_device(struct mii_bus *bus, int addr) if (0xffffffff == phy_id) return NULL; - dev = phy_device_create(bus, addr, phy_id); + /* Otherwise, we allocate the device, and initialize the + * default values */ + dev = kcalloc(1, sizeof(*dev), GFP_KERNEL); + + if (NULL == dev) + return ERR_PTR(-ENOMEM); + + dev->speed = 0; + dev->duplex = -1; + dev->pause = dev->asym_pause = 0; + dev->link = 1; + + dev->autoneg = AUTONEG_ENABLE; + + dev->addr = addr; + dev->phy_id = phy_id; + dev->bus = bus; + + dev->state = PHY_DOWN; + + spin_lock_init(&dev->lock); return dev; }