diff options
| -rw-r--r-- | arch/mips/alchemy/common/platform.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c index 95cb9113b12c..c0f3ce6dcb56 100644 --- a/arch/mips/alchemy/common/platform.c +++ b/arch/mips/alchemy/common/platform.c | |||
| @@ -334,13 +334,12 @@ static void __init alchemy_setup_macs(int ctype) | |||
| 334 | if (alchemy_get_macs(ctype) < 1) | 334 | if (alchemy_get_macs(ctype) < 1) |
| 335 | return; | 335 | return; |
| 336 | 336 | ||
| 337 | macres = kmalloc(sizeof(struct resource) * MAC_RES_COUNT, GFP_KERNEL); | 337 | macres = kmemdup(au1xxx_eth0_resources[ctype], |
| 338 | sizeof(struct resource) * MAC_RES_COUNT, GFP_KERNEL); | ||
| 338 | if (!macres) { | 339 | if (!macres) { |
| 339 | printk(KERN_INFO "Alchemy: no memory for MAC0 resources\n"); | 340 | printk(KERN_INFO "Alchemy: no memory for MAC0 resources\n"); |
| 340 | return; | 341 | return; |
| 341 | } | 342 | } |
| 342 | memcpy(macres, au1xxx_eth0_resources[ctype], | ||
| 343 | sizeof(struct resource) * MAC_RES_COUNT); | ||
| 344 | au1xxx_eth0_device.resource = macres; | 343 | au1xxx_eth0_device.resource = macres; |
| 345 | 344 | ||
| 346 | i = prom_get_ethernet_addr(ethaddr); | 345 | i = prom_get_ethernet_addr(ethaddr); |
| @@ -356,13 +355,12 @@ static void __init alchemy_setup_macs(int ctype) | |||
| 356 | if (alchemy_get_macs(ctype) < 2) | 355 | if (alchemy_get_macs(ctype) < 2) |
| 357 | return; | 356 | return; |
| 358 | 357 | ||
| 359 | macres = kmalloc(sizeof(struct resource) * MAC_RES_COUNT, GFP_KERNEL); | 358 | macres = kmemdup(au1xxx_eth1_resources[ctype], |
| 359 | sizeof(struct resource) * MAC_RES_COUNT, GFP_KERNEL); | ||
| 360 | if (!macres) { | 360 | if (!macres) { |
| 361 | printk(KERN_INFO "Alchemy: no memory for MAC1 resources\n"); | 361 | printk(KERN_INFO "Alchemy: no memory for MAC1 resources\n"); |
| 362 | return; | 362 | return; |
| 363 | } | 363 | } |
| 364 | memcpy(macres, au1xxx_eth1_resources[ctype], | ||
| 365 | sizeof(struct resource) * MAC_RES_COUNT); | ||
| 366 | au1xxx_eth1_device.resource = macres; | 364 | au1xxx_eth1_device.resource = macres; |
| 367 | 365 | ||
| 368 | ethaddr[5] += 1; /* next addr for 2nd MAC */ | 366 | ethaddr[5] += 1; /* next addr for 2nd MAC */ |
