Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280122
b: refs/heads/master
c: 39f1b56
h: refs/heads/master
v: v3
  • Loading branch information
Shubhrajyoti D authored and Grant Likely committed Oct 29, 2011
1 parent 4490975 commit fb0d161
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 751c925cbb3a270f9771e3945494cb44bd9e732a
refs/heads/master: 39f1b56593293a3d1d3b49b97a59337a19fef053
32 changes: 20 additions & 12 deletions trunk/drivers/spi/spi-omap2-mcspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,13 +1115,13 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
mcspi->wq = alloc_workqueue(wq_name, WQ_MEM_RECLAIM, 1);
if (mcspi->wq == NULL) {
status = -ENOMEM;
goto err1;
goto free_master;
}

r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (r == NULL) {
status = -ENODEV;
goto err1;
goto free_master;
}

r->start += pdata->regs_offset;
Expand All @@ -1130,14 +1130,14 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
if (!request_mem_region(r->start, resource_size(r),
dev_name(&pdev->dev))) {
status = -EBUSY;
goto err1;
goto free_master;
}

mcspi->base = ioremap(r->start, resource_size(r));
if (!mcspi->base) {
dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
status = -ENOMEM;
goto err2;
goto release_region;
}

mcspi->dev = &pdev->dev;
Expand All @@ -1152,7 +1152,7 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
GFP_KERNEL);

if (mcspi->dma_channels == NULL)
goto err2;
goto unmap_io;

for (i = 0; i < master->num_chipselect; i++) {
char dma_ch_name[14];
Expand Down Expand Up @@ -1182,26 +1182,33 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
mcspi->dma_channels[i].dma_tx_sync_dev = dma_res->start;
}

if (status < 0)
goto dma_chnl_free;

pm_runtime_enable(&pdev->dev);

if (status || omap2_mcspi_master_setup(mcspi) < 0)
goto err3;
goto disable_pm;

status = spi_register_master(master);
if (status < 0)
goto err4;
goto err_spi_register;

return status;

err4:
err_spi_register:
spi_master_put(master);
err3:
disable_pm:
pm_runtime_disable(&pdev->dev);
dma_chnl_free:
kfree(mcspi->dma_channels);
err2:
release_mem_region(r->start, resource_size(r));
unmap_io:
iounmap(mcspi->base);
err1:
release_region:
release_mem_region(r->start, resource_size(r));
free_master:
kfree(master);
platform_set_drvdata(pdev, NULL);
return status;
}

Expand All @@ -1227,6 +1234,7 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev)
iounmap(base);
kfree(dma_channels);
destroy_workqueue(mcspi->wq);
platform_set_drvdata(pdev, NULL);

return 0;
}
Expand Down

0 comments on commit fb0d161

Please sign in to comment.