13563c6b22b9d128fc7bb1cd4d7e4531b7fe6919
[openwrt.git] / target / linux / ar7 / patches-2.6.24 / 170-_cpmac_phy_fix.diff
1 diff -pruN linux-2.6.24.2.old/drivers/net/cpmac.c linux-2.6.24.2/drivers/net/cpmac.c
2 --- linux-2.6.24.2.old/drivers/net/cpmac.c 2008-03-20 20:33:01.000000000 +0100
3 +++ linux-2.6.24.2/drivers/net/cpmac.c 2008-03-20 20:47:31.000000000 +0100
4 @@ -1112,7 +1112,8 @@ static int external_switch;
5
6 static int __devinit cpmac_probe(struct platform_device *pdev)
7 {
8 - int rc, phy_id, i;
9 + int rc, i;
10 + int phy_id;
11 int mdio_bus_id = cpmac_mii.id;
12 struct resource *mem;
13 struct cpmac_priv *priv;
14 @@ -1132,7 +1133,7 @@ static int __devinit cpmac_probe(struct
15
16 if (phy_id == PHY_MAX_ADDR) {
17 if (external_switch || dumb_switch) {
18 - mdio_bus_id = 0; /* fixed phys bus */
19 + mdio_bus_id = 0;
20 phy_id = pdev->id;
21 } else {
22 dev_err(&pdev->dev, "no PHY present\n");
23 @@ -1178,9 +1179,7 @@ static int __devinit cpmac_probe(struct
24 priv->msg_enable = netif_msg_init(debug_level, 0xff);
25 memcpy(dev->dev_addr, pdata->dev_addr, sizeof(dev->dev_addr));
26
27 - snprintf(priv->phy_name, BUS_ID_SIZE, PHY_ID_FMT, mdio_bus_id, phy_id);
28 -
29 - priv->phy = phy_connect(dev, priv->phy_name, &cpmac_adjust_link, 0,
30 + priv->phy = phy_connect(dev, cpmac_mii.phy_map[phy_id]->dev.bus_id, &cpmac_adjust_link, 0,
31 PHY_INTERFACE_MODE_MII);
32 if (IS_ERR(priv->phy)) {
33 if (netif_msg_drv(priv))
34 @@ -1222,13 +1221,13 @@ static struct platform_driver cpmac_driv
35 .remove = __devexit_p(cpmac_remove),
36 };
37
38 -int __devinit cpmac_init(void)
39 +int __devinit cpmac_init(struct platform_device *pldev, long long base)
40 {
41 u32 mask;
42 int i, res;
43
44 + cpmac_mii.id=pldev->id;
45 cpmac_mii.priv = ioremap(AR7_REGS_MDIO, 256);
46 -
47 if (!cpmac_mii.priv) {
48 printk(KERN_ERR "Can't ioremap mdio registers\n");
49 return -ENXIO;
This page took 0.047093 seconds and 3 git commands to generate.