aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/spear/spdif_out.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index a4a874820ab1..2fdf68c98d22 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -282,27 +282,16 @@ static int spdif_out_probe(struct platform_device *pdev)
282 struct resource *res; 282 struct resource *res;
283 int ret; 283 int ret;
284 284
285 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
286 if (!res)
287 return -EINVAL;
288
289 if (!devm_request_mem_region(&pdev->dev, res->start,
290 resource_size(res), pdev->name)) {
291 dev_warn(&pdev->dev, "Failed to get memory resourse\n");
292 return -ENOENT;
293 }
294
295 host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL); 285 host = devm_kzalloc(&pdev->dev, sizeof(*host), GFP_KERNEL);
296 if (!host) { 286 if (!host) {
297 dev_warn(&pdev->dev, "kzalloc fail\n"); 287 dev_warn(&pdev->dev, "kzalloc fail\n");
298 return -ENOMEM; 288 return -ENOMEM;
299 } 289 }
300 290
301 host->io_base = devm_request_and_ioremap(&pdev->dev, res); 291 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
302 if (!host->io_base) { 292 host->io_base = devm_ioremap_resource(&pdev->dev, res);
303 dev_warn(&pdev->dev, "ioremap failed\n"); 293 if (IS_ERR(host->io_base))
304 return -ENOMEM; 294 return PTR_ERR(host->io_base);
305 }
306 295
307 host->clk = devm_clk_get(&pdev->dev, NULL); 296 host->clk = devm_clk_get(&pdev->dev, NULL);
308 if (IS_ERR(host->clk)) 297 if (IS_ERR(host->clk))