Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190242
b: refs/heads/master
c: 3b1fd3e
h: refs/heads/master
v: v3
  • Loading branch information
Anton Vorontsov authored and David S. Miller committed Apr 23, 2010
1 parent 319e346 commit 187758f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fda48a0d7a8412cedacda46a9c0bf8ef9cd13559
refs/heads/master: 3b1fd3e55a39824e68bc8dd055d14892476e3671
20 changes: 14 additions & 6 deletions trunk/drivers/net/fsl_pq_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,6 @@ static int fsl_pq_mdio_find_free(struct mii_bus *new_bus)
static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct device_node *np)
{
struct gfar __iomem *enet_regs;
u32 __iomem *ioremap_tbipa;
u64 addr, size;

/*
* This is mildly evil, but so is our hardware for doing this.
Expand All @@ -220,9 +218,7 @@ static u32 __iomem *get_gfar_tbipa(struct fsl_pq_mdio __iomem *regs, struct devi
return &enet_regs->tbipa;
} else if (of_device_is_compatible(np, "fsl,etsec2-mdio") ||
of_device_is_compatible(np, "fsl,etsec2-tbi")) {
addr = of_translate_address(np, of_get_address(np, 1, &size, NULL));
ioremap_tbipa = ioremap(addr, size);
return ioremap_tbipa;
return of_iomap(np, 1);
} else
return NULL;
}
Expand Down Expand Up @@ -279,6 +275,7 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev,
u32 __iomem *tbipa;
struct mii_bus *new_bus;
int tbiaddr = -1;
const u32 *addrp;
u64 addr = 0, size = 0;
int err = 0;

Expand All @@ -297,8 +294,19 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev,
new_bus->priv = priv;
fsl_pq_mdio_bus_name(new_bus->id, np);

addrp = of_get_address(np, 0, &size, NULL);
if (!addrp) {
err = -EINVAL;
goto err_free_bus;
}

/* Set the PHY base address */
addr = of_translate_address(np, of_get_address(np, 0, &size, NULL));
addr = of_translate_address(np, addrp);
if (addr == OF_BAD_ADDR) {
err = -EINVAL;
goto err_free_bus;
}

map = ioremap(addr, size);
if (!map) {
err = -ENOMEM;
Expand Down

0 comments on commit 187758f

Please sign in to comment.