Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250380
b: refs/heads/master
c: 31705e2
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Paul Mundt committed May 23, 2011
1 parent b375b8e commit 7c9bb97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 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: 467017b83b5bc445be5d275cf727b4f7ba3d2b2d
refs/heads/master: 31705e21f9b5a0628c043f88ff4d20488b47b8ab
16 changes: 8 additions & 8 deletions trunk/drivers/dma/shdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,6 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
struct sh_dmae_pdata *pdata = pdev->dev.platform_data;
unsigned long irqflags = IRQF_DISABLED,
chan_flag[SH_DMAC_MAX_CHANNELS] = {};
unsigned long flags;
int errirq, chan_irq[SH_DMAC_MAX_CHANNELS];
int err, i, irq_cnt = 0, irqres = 0;
struct sh_dmae_device *shdev;
Expand Down Expand Up @@ -1143,9 +1142,9 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
pm_runtime_get_sync(&pdev->dev);

spin_lock_irqsave(&sh_dmae_lock, flags);
spin_lock_irq(&sh_dmae_lock);
list_add_tail_rcu(&shdev->node, &sh_dmae_devices);
spin_unlock_irqrestore(&sh_dmae_lock, flags);
spin_unlock_irq(&sh_dmae_lock);

/* reset dma controller - only needed as a test */
err = sh_dmae_rst(shdev);
Expand Down Expand Up @@ -1250,9 +1249,9 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
eirq_err:
#endif
rst_err:
spin_lock_irqsave(&sh_dmae_lock, flags);
spin_lock_irq(&sh_dmae_lock);
list_del_rcu(&shdev->node);
spin_unlock_irqrestore(&sh_dmae_lock, flags);
spin_unlock_irq(&sh_dmae_lock);

pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
Expand All @@ -1261,6 +1260,7 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
iounmap(shdev->dmars);
emapdmars:
iounmap(shdev->chan_reg);
synchronize_rcu();
emapchan:
kfree(shdev);
ealloc:
Expand All @@ -1276,17 +1276,16 @@ static int __exit sh_dmae_remove(struct platform_device *pdev)
{
struct sh_dmae_device *shdev = platform_get_drvdata(pdev);
struct resource *res;
unsigned long flags;
int errirq = platform_get_irq(pdev, 0);

dma_async_device_unregister(&shdev->common);

if (errirq > 0)
free_irq(errirq, shdev);

spin_lock_irqsave(&sh_dmae_lock, flags);
spin_lock_irq(&sh_dmae_lock);
list_del_rcu(&shdev->node);
spin_unlock_irqrestore(&sh_dmae_lock, flags);
spin_unlock_irq(&sh_dmae_lock);

/* channel data remove */
sh_dmae_chan_remove(shdev);
Expand All @@ -1297,6 +1296,7 @@ static int __exit sh_dmae_remove(struct platform_device *pdev)
iounmap(shdev->dmars);
iounmap(shdev->chan_reg);

synchronize_rcu();
kfree(shdev);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Expand Down

0 comments on commit 7c9bb97

Please sign in to comment.