diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-19 05:57:38 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-19 05:57:38 -0400 |
commit | 031d3076675708aab4c5c189f39d6cd74abd80cf (patch) | |
tree | 50ad6c29c2a39026883c16fa4e5e7aaf5440428f /drivers/mfd | |
parent | 8eb12b98163deaafae82e7dde044709919e4fdfa (diff) | |
parent | 3f9850f26241f1d4f9ed49eaa70e043a3bb24a7c (diff) |
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/davinci_voicecodec.c | 48 | ||||
-rw-r--r-- | drivers/mfd/htc-egpio.c | 4 |
2 files changed, 12 insertions, 40 deletions
diff --git a/drivers/mfd/davinci_voicecodec.c b/drivers/mfd/davinci_voicecodec.c index b6e297363946..fb64398506e9 100644 --- a/drivers/mfd/davinci_voicecodec.c +++ b/drivers/mfd/davinci_voicecodec.c | |||
@@ -46,7 +46,7 @@ void davinci_vc_write(struct davinci_vc *davinci_vc, | |||
46 | static int __init davinci_vc_probe(struct platform_device *pdev) | 46 | static int __init davinci_vc_probe(struct platform_device *pdev) |
47 | { | 47 | { |
48 | struct davinci_vc *davinci_vc; | 48 | struct davinci_vc *davinci_vc; |
49 | struct resource *res, *mem; | 49 | struct resource *res; |
50 | struct mfd_cell *cell = NULL; | 50 | struct mfd_cell *cell = NULL; |
51 | int ret; | 51 | int ret; |
52 | 52 | ||
@@ -58,7 +58,7 @@ static int __init davinci_vc_probe(struct platform_device *pdev) | |||
58 | return -ENOMEM; | 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 | if (IS_ERR(davinci_vc->clk)) { | 62 | if (IS_ERR(davinci_vc->clk)) { |
63 | dev_dbg(&pdev->dev, | 63 | dev_dbg(&pdev->dev, |
64 | "could not get the clock for voice codec\n"); | 64 | "could not get the clock for voice codec\n"); |
@@ -67,35 +67,18 @@ static int __init davinci_vc_probe(struct platform_device *pdev) | |||
67 | clk_enable(davinci_vc->clk); | 67 | clk_enable(davinci_vc->clk); |
68 | 68 | ||
69 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 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 | |||
76 | davinci_vc->pbase = res->start; | ||
77 | davinci_vc->base_size = resource_size(res); | ||
78 | 70 | ||
79 | mem = request_mem_region(davinci_vc->pbase, davinci_vc->base_size, | 71 | davinci_vc->base = devm_ioremap_resource(&pdev->dev, res); |
80 | pdev->name); | 72 | if (IS_ERR(davinci_vc->base)) { |
81 | if (!mem) { | 73 | ret = PTR_ERR(davinci_vc->base); |
82 | dev_err(&pdev->dev, "VCIF region already claimed\n"); | 74 | goto fail; |
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; | ||
92 | } | 75 | } |
93 | 76 | ||
94 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 77 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
95 | if (!res) { | 78 | if (!res) { |
96 | dev_err(&pdev->dev, "no DMA resource\n"); | 79 | dev_err(&pdev->dev, "no DMA resource\n"); |
97 | ret = -ENXIO; | 80 | ret = -ENXIO; |
98 | goto fail4; | 81 | goto fail; |
99 | } | 82 | } |
100 | 83 | ||
101 | davinci_vc->davinci_vcif.dma_tx_channel = res->start; | 84 | davinci_vc->davinci_vcif.dma_tx_channel = res->start; |
@@ -106,7 +89,7 @@ static int __init davinci_vc_probe(struct platform_device *pdev) | |||
106 | if (!res) { | 89 | if (!res) { |
107 | dev_err(&pdev->dev, "no DMA resource\n"); | 90 | dev_err(&pdev->dev, "no DMA resource\n"); |
108 | ret = -ENXIO; | 91 | ret = -ENXIO; |
109 | goto fail4; | 92 | goto fail; |
110 | } | 93 | } |
111 | 94 | ||
112 | davinci_vc->davinci_vcif.dma_rx_channel = res->start; | 95 | davinci_vc->davinci_vcif.dma_rx_channel = res->start; |
@@ -132,19 +115,13 @@ static int __init davinci_vc_probe(struct platform_device *pdev) | |||
132 | DAVINCI_VC_CELLS, NULL, 0, NULL); | 115 | DAVINCI_VC_CELLS, NULL, 0, NULL); |
133 | if (ret != 0) { | 116 | if (ret != 0) { |
134 | dev_err(&pdev->dev, "fail to register client devices\n"); | 117 | dev_err(&pdev->dev, "fail to register client devices\n"); |
135 | goto fail4; | 118 | goto fail; |
136 | } | 119 | } |
137 | 120 | ||
138 | return 0; | 121 | return 0; |
139 | 122 | ||
140 | fail4: | 123 | fail: |
141 | iounmap(davinci_vc->base); | ||
142 | fail3: | ||
143 | release_mem_region(davinci_vc->pbase, davinci_vc->base_size); | ||
144 | fail2: | ||
145 | clk_disable(davinci_vc->clk); | 124 | clk_disable(davinci_vc->clk); |
146 | clk_put(davinci_vc->clk); | ||
147 | davinci_vc->clk = NULL; | ||
148 | 125 | ||
149 | return ret; | 126 | return ret; |
150 | } | 127 | } |
@@ -155,12 +132,7 @@ static int davinci_vc_remove(struct platform_device *pdev) | |||
155 | 132 | ||
156 | mfd_remove_devices(&pdev->dev); | 133 | mfd_remove_devices(&pdev->dev); |
157 | 134 | ||
158 | iounmap(davinci_vc->base); | ||
159 | release_mem_region(davinci_vc->pbase, davinci_vc->base_size); | ||
160 | |||
161 | clk_disable(davinci_vc->clk); | 135 | clk_disable(davinci_vc->clk); |
162 | clk_put(davinci_vc->clk); | ||
163 | davinci_vc->clk = NULL; | ||
164 | 136 | ||
165 | return 0; | 137 | return 0; |
166 | } | 138 | } |
diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c index f2e0ad4b332e..26aca545084b 100644 --- a/drivers/mfd/htc-egpio.c +++ b/drivers/mfd/htc-egpio.c | |||
@@ -286,7 +286,8 @@ static int __init egpio_probe(struct platform_device *pdev) | |||
286 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 286 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
287 | if (!res) | 287 | if (!res) |
288 | goto fail; | 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 | if (!ei->base_addr) | 291 | if (!ei->base_addr) |
291 | goto fail; | 292 | goto fail; |
292 | pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr); | 293 | pr_debug("EGPIO phys=%08x virt=%p\n", (u32)res->start, ei->base_addr); |
@@ -380,7 +381,6 @@ static int __exit egpio_remove(struct platform_device *pdev) | |||
380 | irq_set_chained_handler(ei->chained_irq, NULL); | 381 | irq_set_chained_handler(ei->chained_irq, NULL); |
381 | device_init_wakeup(&pdev->dev, 0); | 382 | device_init_wakeup(&pdev->dev, 0); |
382 | } | 383 | } |
383 | iounmap(ei->base_addr); | ||
384 | 384 | ||
385 | return 0; | 385 | return 0; |
386 | } | 386 | } |