Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150015
b: refs/heads/master
c: 324931b
h: refs/heads/master
i:
  150013: 9231ae7
  150011: d9a9308
  150007: b910c9c
  149999: 2edf247
  149983: 365dece
  149951: f1f465a
  149887: 90480dc
  149759: 00c6ac3
  149503: 95bf031
v: v3
  • Loading branch information
Grant Likely authored and David S. Miller committed Apr 27, 2009
1 parent 5aea539 commit 0aeba74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 49 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: ca816d98170942371535b3e862813b0aba9b7d90
refs/heads/master: 324931ba21858c34787dee7d222388ef3fb41ee0
51 changes: 3 additions & 48 deletions trunk/drivers/net/fsl_pq_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/mii.h>
#include <linux/phy.h>
#include <linux/of.h>
#include <linux/of_mdio.h>
#include <linux/of_platform.h>

#include <asm/io.h>
Expand Down Expand Up @@ -154,44 +155,6 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus)
return 0;
}

/* Allocate an array which provides irq #s for each PHY on the given bus */
static int *create_irq_map(struct device_node *np)
{
int *irqs;
int i;
struct device_node *child = NULL;

irqs = kcalloc(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL);

if (!irqs)
return NULL;

for (i = 0; i < PHY_MAX_ADDR; i++)
irqs[i] = PHY_POLL;

while ((child = of_get_next_child(np, child)) != NULL) {
int irq = irq_of_parse_and_map(child, 0);
const u32 *id;

if (irq == NO_IRQ)
continue;

id = of_get_property(child, "reg", NULL);

if (!id)
continue;

if (*id < PHY_MAX_ADDR && *id >= 0)
irqs[*id] = irq;
else
printk(KERN_WARNING "%s: "
"%d is not a valid PHY address\n",
np->full_name, *id);
}

return irqs;
}

void fsl_pq_mdio_bus_name(char *name, struct device_node *np)
{
const u32 *addr;
Expand Down Expand Up @@ -315,7 +278,7 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev,

new_bus->priv = (void __force *)regs;

new_bus->irq = create_irq_map(np);
new_bus->irq = kcalloc(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL);

if (NULL == new_bus->irq) {
err = -ENOMEM;
Expand Down Expand Up @@ -384,15 +347,7 @@ static int fsl_pq_mdio_probe(struct of_device *ofdev,

out_be32(tbipa, tbiaddr);

/*
* The TBIPHY-only buses will find PHYs at every address,
* so we mask them all but the TBI
*/
if (of_device_is_compatible(np, "fsl,gianfar-tbi"))
new_bus->phy_mask = ~(1 << tbiaddr);

err = mdiobus_register(new_bus);

err = of_mdiobus_register(new_bus, np);
if (err) {
printk (KERN_ERR "%s: Cannot register as MDIO bus\n",
new_bus->name);
Expand Down

0 comments on commit 0aeba74

Please sign in to comment.