Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 56871
b: refs/heads/master
c: 8888735
h: refs/heads/master
i:
  56869: 5cdeadc
  56867: 73de9cb
  56863: 7ac0d8f
v: v3
  • Loading branch information
Domen Puncer authored and Linus Torvalds committed May 24, 2007
1 parent 1fa5546 commit f38fc6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 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: b9ba347f27f2508e3da023688d047e111cbbe2da
refs/heads/master: 8888735fcaac7681dbcca67fbcc88cf627c47b3a
25 changes: 11 additions & 14 deletions trunk/drivers/spi/mpc52xx_psc_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
int ret = 0;

#if defined(CONFIG_PPC_MERGE)
cdm = mpc52xx_find_and_map("mpc52xx-cdm");
gpio = mpc52xx_find_and_map("mpc52xx-gpio");
cdm = mpc52xx_find_and_map("mpc5200-cdm");
gpio = mpc52xx_find_and_map("mpc5200-gpio");
#else
cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
Expand Down Expand Up @@ -445,9 +445,6 @@ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr,
struct spi_master *master;
int ret;

if (pdata == NULL)
return -ENODEV;

master = spi_alloc_master(dev, sizeof *mps);
if (master == NULL)
return -ENOMEM;
Expand Down Expand Up @@ -594,17 +591,17 @@ static int __init mpc52xx_psc_spi_of_probe(struct of_device *op,
}
regaddr64 = of_translate_address(op->node, regaddr_p);

/* get PSC id (1..6, used by port_config) */
if (op->dev.platform_data == NULL) {
struct device_node *np;
int i = 0;
const u32 *psc_nump;

for_each_node_by_type(np, "spi") {
if (of_find_device_by_node(np) == op) {
id = i;
break;
}
i++;
psc_nump = of_get_property(op->node, "cell-index", NULL);
if (!psc_nump || *psc_nump > 5) {
printk(KERN_ERR "mpc52xx_psc_spi: Device node %s has invalid "
"cell-index property\n", op->node->full_name);
return -EINVAL;
}
id = *psc_nump + 1;
}

return mpc52xx_psc_spi_do_probe(&op->dev, (u32)regaddr64, (u32)size64,
Expand All @@ -617,7 +614,7 @@ static int __exit mpc52xx_psc_spi_of_remove(struct of_device *op)
}

static struct of_device_id mpc52xx_psc_spi_of_match[] = {
{ .type = "spi", .compatible = "mpc52xx-psc-spi", },
{ .type = "spi", .compatible = "mpc5200-psc-spi", },
{},
};

Expand Down

0 comments on commit f38fc6c

Please sign in to comment.