1 Index: linux-2.6.23.17/drivers/net/phy/fixed.c
2 ===================================================================
3 --- linux-2.6.23.17.orig/drivers/net/phy/fixed.c
4 +++ linux-2.6.23.17/drivers/net/phy/fixed.c
5 @@ -189,6 +189,19 @@ static struct phy_driver fixed_mdio_driv
6 .driver = { .owner = THIS_MODULE,},
9 +static void fixed_mdio_release (struct device * dev)
11 + struct phy_device *phydev = container_of(dev, struct phy_device, dev);
12 + struct mii_bus *bus = phydev->bus;
13 + struct fixed_info *fixed = bus->priv;
22 /*-----------------------------------------------------------------------------
23 * This func is used to create all the necessary stuff, bind
24 * the fixed phy driver and register all it on the mdio_bus_type.
25 @@ -224,6 +237,12 @@ static int fixed_mdio_register_device(in
28 fixed->regs = kzalloc(MII_REGS_NUM*sizeof(int), GFP_KERNEL);
29 + if (NULL == fixed->regs) {
35 fixed->regs_num = MII_REGS_NUM;
36 fixed->phy_status.speed = speed;
37 fixed->phy_status.duplex = duplex;
38 @@ -252,8 +271,11 @@ static int fixed_mdio_register_device(in
39 fixed->phydev = phydev;
43 - goto device_create_fail;
51 phydev->irq = PHY_IGNORE_INTERRUPT;
52 @@ -265,8 +287,33 @@ static int fixed_mdio_register_device(in
54 snprintf(phydev->dev.bus_id, BUS_ID_SIZE,
55 "fixed@%d:%d", speed, duplex);
57 phydev->bus = new_bus;
60 + phydev->dev.driver = &fixed_mdio_driver.driver;
61 + phydev->dev.release = fixed_mdio_release;
63 + err = phydev->dev.driver->probe(&phydev->dev);
65 + printk(KERN_ERR "Phy %s: problems with fixed driver\n",
66 + phydev->dev.bus_id);
75 + err = device_register(&phydev->dev);
77 + printk(KERN_ERR "Phy %s failed to register\n",
78 + phydev->dev.bus_id);
83 err = device_register(&phydev->dev);
85 printk(KERN_ERR "Phy %s failed to register\n",
86 @@ -303,6 +350,7 @@ device_create_fail: