diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2005-12-13 02:01:21 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-08 22:53:55 -0500 |
commit | cc5d0189b9ba95260857a5018a1c2fef90008507 (patch) | |
tree | 1202c94b6b3cb81a96d0a0e54424cad10eef68bb /drivers/serial/pmac_zilog.c | |
parent | 9cf84d7c97992dbe5360b241327341c07ce30fc9 (diff) |
[PATCH] powerpc: Remove device_node addrs/n_addr
The pre-parsed addrs/n_addrs fields in struct device_node are finally
gone. Remove the dodgy heuristics that did that parsing at boot and
remove the fields themselves since we now have a good replacement with
the new OF parsing code. This patch also fixes a bunch of drivers to use
the new code instead, so that at least pmac32, pseries, iseries and g5
defconfigs build.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/serial/pmac_zilog.c')
-rw-r--r-- | drivers/serial/pmac_zilog.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 5ddd8ab1f10..ea24129eb6b 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c | |||
@@ -1431,11 +1431,14 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) | |||
1431 | char name[1]; | 1431 | char name[1]; |
1432 | } *slots; | 1432 | } *slots; |
1433 | int len; | 1433 | int len; |
1434 | struct resource r_ports, r_rxdma, r_txdma; | ||
1434 | 1435 | ||
1435 | /* | 1436 | /* |
1436 | * Request & map chip registers | 1437 | * Request & map chip registers |
1437 | */ | 1438 | */ |
1438 | uap->port.mapbase = np->addrs[0].address; | 1439 | if (of_address_to_resource(np, 0, &r_ports)) |
1440 | return -ENODEV; | ||
1441 | uap->port.mapbase = r_ports.start; | ||
1439 | uap->port.membase = ioremap(uap->port.mapbase, 0x1000); | 1442 | uap->port.membase = ioremap(uap->port.mapbase, 0x1000); |
1440 | 1443 | ||
1441 | uap->control_reg = uap->port.membase; | 1444 | uap->control_reg = uap->port.membase; |
@@ -1445,16 +1448,20 @@ static int __init pmz_init_port(struct uart_pmac_port *uap) | |||
1445 | * Request & map DBDMA registers | 1448 | * Request & map DBDMA registers |
1446 | */ | 1449 | */ |
1447 | #ifdef HAS_DBDMA | 1450 | #ifdef HAS_DBDMA |
1448 | if (np->n_addrs >= 3 && np->n_intrs >= 3) | 1451 | if (of_address_to_resource(np, 1, &r_txdma) == 0 && |
1452 | of_address_to_resource(np, 2, &r_rxdma) == 0) | ||
1449 | uap->flags |= PMACZILOG_FLAG_HAS_DMA; | 1453 | uap->flags |= PMACZILOG_FLAG_HAS_DMA; |
1454 | #else | ||
1455 | memset(&r_txdma, 0, sizeof(struct resource)); | ||
1456 | memset(&r_rxdma, 0, sizeof(struct resource)); | ||
1450 | #endif | 1457 | #endif |
1451 | if (ZS_HAS_DMA(uap)) { | 1458 | if (ZS_HAS_DMA(uap)) { |
1452 | uap->tx_dma_regs = ioremap(np->addrs[np->n_addrs - 2].address, 0x1000); | 1459 | uap->tx_dma_regs = ioremap(r_txdma.start, 0x100); |
1453 | if (uap->tx_dma_regs == NULL) { | 1460 | if (uap->tx_dma_regs == NULL) { |
1454 | uap->flags &= ~PMACZILOG_FLAG_HAS_DMA; | 1461 | uap->flags &= ~PMACZILOG_FLAG_HAS_DMA; |
1455 | goto no_dma; | 1462 | goto no_dma; |
1456 | } | 1463 | } |
1457 | uap->rx_dma_regs = ioremap(np->addrs[np->n_addrs - 1].address, 0x1000); | 1464 | uap->rx_dma_regs = ioremap(r_rxdma.start, 0x100); |
1458 | if (uap->rx_dma_regs == NULL) { | 1465 | if (uap->rx_dma_regs == NULL) { |
1459 | iounmap(uap->tx_dma_regs); | 1466 | iounmap(uap->tx_dma_regs); |
1460 | uap->tx_dma_regs = NULL; | 1467 | uap->tx_dma_regs = NULL; |