aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-10-15 05:34:34 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-15 14:29:49 -0400
commit792036952123a0670c7dd6960ca5458cdfd5e4fd (patch)
treea9a67cca154acddc467e504c796fa72390ba7cc6 /drivers/net
parentbc2618f7528d4b6ea0c2c53539a3b8cff2b33b24 (diff)
Update ibm_newemac to use dcr_host_t.base
Now that dcr_host_t contains the base address, we can use that in the ibm_newemac code, rather than storing it separately. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ibm_newemac/mal.c9
-rw-r--r--drivers/net/ibm_newemac/mal.h5
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c
index 58854117b1a9..748a86969d73 100644
--- a/drivers/net/ibm_newemac/mal.c
+++ b/drivers/net/ibm_newemac/mal.c
@@ -461,6 +461,7 @@ static int __devinit mal_probe(struct of_device *ofdev,
461 struct mal_instance *mal; 461 struct mal_instance *mal;
462 int err = 0, i, bd_size; 462 int err = 0, i, bd_size;
463 int index = mal_count++; 463 int index = mal_count++;
464 unsigned int dcr_base;
464 const u32 *prop; 465 const u32 *prop;
465 u32 cfg; 466 u32 cfg;
466 467
@@ -497,14 +498,14 @@ static int __devinit mal_probe(struct of_device *ofdev,
497 } 498 }
498 mal->num_rx_chans = prop[0]; 499 mal->num_rx_chans = prop[0];
499 500
500 mal->dcr_base = dcr_resource_start(ofdev->node, 0); 501 dcr_base = dcr_resource_start(ofdev->node, 0);
501 if (mal->dcr_base == 0) { 502 if (dcr_base == 0) {
502 printk(KERN_ERR 503 printk(KERN_ERR
503 "mal%d: can't find DCR resource!\n", index); 504 "mal%d: can't find DCR resource!\n", index);
504 err = -ENODEV; 505 err = -ENODEV;
505 goto fail; 506 goto fail;
506 } 507 }
507 mal->dcr_host = dcr_map(ofdev->node, mal->dcr_base, 0x100); 508 mal->dcr_host = dcr_map(ofdev->node, dcr_base, 0x100);
508 if (!DCR_MAP_OK(mal->dcr_host)) { 509 if (!DCR_MAP_OK(mal->dcr_host)) {
509 printk(KERN_ERR 510 printk(KERN_ERR
510 "mal%d: failed to map DCRs !\n", index); 511 "mal%d: failed to map DCRs !\n", index);
@@ -626,7 +627,7 @@ static int __devinit mal_probe(struct of_device *ofdev,
626 fail2: 627 fail2:
627 dma_free_coherent(&ofdev->dev, bd_size, mal->bd_virt, mal->bd_dma); 628 dma_free_coherent(&ofdev->dev, bd_size, mal->bd_virt, mal->bd_dma);
628 fail_unmap: 629 fail_unmap:
629 dcr_unmap(mal->dcr_host, mal->dcr_base, 0x100); 630 dcr_unmap(mal->dcr_host, dcr_base, 0x100);
630 fail: 631 fail:
631 kfree(mal); 632 kfree(mal);
632 633
diff --git a/drivers/net/ibm_newemac/mal.h b/drivers/net/ibm_newemac/mal.h
index cb1a16d589fe..6daa98e5992e 100644
--- a/drivers/net/ibm_newemac/mal.h
+++ b/drivers/net/ibm_newemac/mal.h
@@ -185,7 +185,6 @@ struct mal_commac {
185 185
186struct mal_instance { 186struct mal_instance {
187 int version; 187 int version;
188 int dcr_base;
189 dcr_host_t dcr_host; 188 dcr_host_t dcr_host;
190 189
191 int num_tx_chans; /* Number of TX channels */ 190 int num_tx_chans; /* Number of TX channels */
@@ -213,12 +212,12 @@ struct mal_instance {
213 212
214static inline u32 get_mal_dcrn(struct mal_instance *mal, int reg) 213static inline u32 get_mal_dcrn(struct mal_instance *mal, int reg)
215{ 214{
216 return dcr_read(mal->dcr_host, mal->dcr_base + reg); 215 return dcr_read(mal->dcr_host, mal->dcr_host.base + reg);
217} 216}
218 217
219static inline void set_mal_dcrn(struct mal_instance *mal, int reg, u32 val) 218static inline void set_mal_dcrn(struct mal_instance *mal, int reg, u32 val)
220{ 219{
221 dcr_write(mal->dcr_host, mal->dcr_base + reg, val); 220 dcr_write(mal->dcr_host, mal->dcr_host.base + reg, val);
222} 221}
223 222
224/* Register MAL devices */ 223/* Register MAL devices */