Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-mfd-next' of git://git.linaro.org/people/ljones/linux-3.0-ux500

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

+12 -42
+10 -38
drivers/mfd/davinci_voicecodec.c
··· 46 46 static int __init davinci_vc_probe(struct platform_device *pdev) 47 47 { 48 48 struct davinci_vc *davinci_vc; 49 - struct resource *res, *mem; 49 + struct resource *res; 50 50 struct mfd_cell *cell = NULL; 51 51 int ret; 52 52 ··· 58 58 return -ENOMEM; 59 59 } 60 60 61 - davinci_vc->clk = clk_get(&pdev->dev, NULL); 61 + davinci_vc->clk = devm_clk_get(&pdev->dev, NULL); 62 62 if (IS_ERR(davinci_vc->clk)) { 63 63 dev_dbg(&pdev->dev, 64 64 "could not get the clock for voice codec\n"); ··· 67 67 clk_enable(davinci_vc->clk); 68 68 69 69 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 70 - if (!res) { 71 - dev_err(&pdev->dev, "no mem resource\n"); 72 - ret = -ENODEV; 73 - goto fail2; 74 - } 75 70 76 - davinci_vc->pbase = res->start; 77 - davinci_vc->base_size = resource_size(res); 78 - 79 - mem = request_mem_region(davinci_vc->pbase, davinci_vc->base_size, 80 - pdev->name); 81 - if (!mem) { 82 - dev_err(&pdev->dev, "VCIF region already claimed\n"); 83 - ret = -EBUSY; 84 - goto fail2; 85 - } 86 - 87 - davinci_vc->base = ioremap(davinci_vc->pbase, davinci_vc->base_size); 88 - if (!davinci_vc->base) { 89 - dev_err(&pdev->dev, "can't ioremap mem resource.\n"); 90 - ret = -ENOMEM; 91 - goto fail3; 71 + davinci_vc->base = devm_ioremap_resource(&pdev->dev, res); 72 + if (IS_ERR(davinci_vc->base)) { 73 + ret = PTR_ERR(davinci_vc->base); 74 + goto fail; 92 75 } 93 76 94 77 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); 95 78 if (!res) { 96 79 dev_err(&pdev->dev, "no DMA resource\n"); 97 80 ret = -ENXIO; 98 - goto fail4; 81 + goto fail; 99 82 } 100 83 101 84 davinci_vc->davinci_vcif.dma_tx_channel = res->start; ··· 89 106 if (!res) { 90 107 dev_err(&pdev->dev, "no DMA resource\n"); 91 108 ret = -ENXIO; 92 - goto fail4; 109 + goto fail; 93 110 } 94 111 95 112 davinci_vc->davinci_vcif.dma_rx_channel = res->start; ··· 115 132 DAVINCI_VC_CELLS, NULL, 0, NULL); 116 133 if (ret != 0) { 117 134 dev_err(&pdev->dev, "fail to register client devices\n"); 118 - goto fail4; 135 + goto fail; 119 136 } 120 137 121 138 return 0; 122 139 123 - fail4: 124 - iounmap(davinci_vc->base); 125 - fail3: 126 - release_mem_region(davinci_vc->pbase, davinci_vc->base_size); 127 - fail2: 140 + fail: 128 141 clk_disable(davinci_vc->clk); 129 - clk_put(davinci_vc->clk); 130 - davinci_vc->clk = NULL; 131 142 132 143 return ret; 133 144 } ··· 132 155 133 156 mfd_remove_devices(&pdev->dev); 134 157 135 - iounmap(davinci_vc->base); 136 - release_mem_region(davinci_vc->pbase, davinci_vc->base_size); 137 - 138 158 clk_disable(davinci_vc->clk); 139 - clk_put(davinci_vc->clk); 140 - davinci_vc->clk = NULL; 141 159 142 160 return 0; 143 161 }
+2 -2
drivers/mfd/htc-egpio.c
··· 286 286 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 287 287 if (!res) 288 288 goto fail; 289 - ei->base_addr = ioremap_nocache(res->start, resource_size(res)); 289 + ei->base_addr = devm_ioremap_nocache(&pdev->dev, res->start, 290 + resource_size(res)); 290 291 if (!ei->base_addr) 291 292 goto fail; 292 293 pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr); ··· 381 380 irq_set_chained_handler(ei->chained_irq, NULL); 382 381 device_init_wakeup(&pdev->dev, 0); 383 382 } 384 - iounmap(ei->base_addr); 385 383 386 384 return 0; 387 385 }
-2
include/linux/mfd/davinci_voicecodec.h
··· 112 112 113 113 /* Memory resources */ 114 114 void __iomem *base; 115 - resource_size_t pbase; 116 - size_t base_size; 117 115 118 116 /* MFD cells */ 119 117 struct mfd_cell cells[DAVINCI_VC_CELLS];