Merge git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemoen/avr32-2.6:
avr32: clean up memory allocation in at32_add_device_mci
arch/avr32: Fix build failure for avr32 caused by typo

+9 -6
+9 -6
arch/avr32/mach-at32ap/at32ap700x.c
··· 1325 at32_add_device_mci(unsigned int id, struct mci_platform_data *data) 1326 { 1327 struct platform_device *pdev; 1328 - struct mci_dma_slave *slave; 1329 u32 pioa_mask; 1330 u32 piob_mask; 1331 ··· 1344 ARRAY_SIZE(atmel_mci0_resource))) 1345 goto fail; 1346 1347 - slave = kzalloc(sizeof(struct mci_dma_slave), GFP_KERNEL); 1348 1349 slave->sdata.dma_dev = &dw_dmac0_device.dev; 1350 slave->sdata.reg_width = DW_DMA_SLAVE_WIDTH_32BIT; ··· 1359 1360 if (platform_device_add_data(pdev, data, 1361 sizeof(struct mci_platform_data))) 1362 - goto fail; 1363 1364 /* CLK line is common to both slots */ 1365 pioa_mask = 1 << 10; ··· 1383 /* Slot is unused */ 1384 break; 1385 default: 1386 - goto fail; 1387 } 1388 1389 select_peripheral(PIOA, pioa_mask, PERIPH_A, 0); ··· 1410 break; 1411 default: 1412 if (!data->slot[0].bus_width) 1413 - goto fail; 1414 1415 data->slot[1].bus_width = 0; 1416 break; ··· 1421 platform_device_add(pdev); 1422 return pdev; 1423 1424 fail: 1425 data->dma_slave = NULL; 1426 - kfree(slave); 1427 platform_device_put(pdev); 1428 return NULL; 1429 }
··· 1325 at32_add_device_mci(unsigned int id, struct mci_platform_data *data) 1326 { 1327 struct platform_device *pdev; 1328 + struct mci_dma_data *slave; 1329 u32 pioa_mask; 1330 u32 piob_mask; 1331 ··· 1344 ARRAY_SIZE(atmel_mci0_resource))) 1345 goto fail; 1346 1347 + slave = kzalloc(sizeof(struct mci_dma_data), GFP_KERNEL); 1348 + if (!slave) 1349 + goto fail; 1350 1351 slave->sdata.dma_dev = &dw_dmac0_device.dev; 1352 slave->sdata.reg_width = DW_DMA_SLAVE_WIDTH_32BIT; ··· 1357 1358 if (platform_device_add_data(pdev, data, 1359 sizeof(struct mci_platform_data))) 1360 + goto fail_free; 1361 1362 /* CLK line is common to both slots */ 1363 pioa_mask = 1 << 10; ··· 1381 /* Slot is unused */ 1382 break; 1383 default: 1384 + goto fail_free; 1385 } 1386 1387 select_peripheral(PIOA, pioa_mask, PERIPH_A, 0); ··· 1408 break; 1409 default: 1410 if (!data->slot[0].bus_width) 1411 + goto fail_free; 1412 1413 data->slot[1].bus_width = 0; 1414 break; ··· 1419 platform_device_add(pdev); 1420 return pdev; 1421 1422 + fail_free: 1423 + kfree(slave); 1424 fail: 1425 data->dma_slave = NULL; 1426 platform_device_put(pdev); 1427 return NULL; 1428 }