summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-01-07 11:03:37 +0900
committerPaul Mundt <lethal@linux-sh.org>2011-01-07 11:03:37 +0900
commit04a186bd2c4d3fd7efdeb91d2e92f4624be3a764 (patch)
tree487fed8e06d0599f3a2248385c18a63b3036de12 /drivers
parente9d728f528f9548c8dd013899b23e662fa7b6bca (diff)
parent661382fe190475c17d0b3a6b5f0350b4f82f5939 (diff)
Merge branch 'common/dma' into rmobile-latest
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dma/shdma.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index a0069c17151..28720d3103c 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -1110,11 +1110,6 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
list_add_tail_rcu(&shdev->node, &sh_dmae_devices);
spin_unlock_irqrestore(&sh_dmae_lock, flags);
- /* Wire up NMI handling before bringing the controller online */
- err = register_die_notifier(&sh_dmae_nmi_notifier);
- if (err)
- goto notifier_err;
-
/* reset dma controller */
err = sh_dmae_rst(shdev);
if (err)
@@ -1218,8 +1213,6 @@ eirqres:
eirq_err:
#endif
rst_err:
- unregister_die_notifier(&sh_dmae_nmi_notifier);
-notifier_err:
spin_lock_irqsave(&sh_dmae_lock, flags);
list_del_rcu(&shdev->node);
spin_unlock_irqrestore(&sh_dmae_lock, flags);
@@ -1252,8 +1245,6 @@ static int __exit sh_dmae_remove(struct platform_device *pdev)
if (errirq > 0)
free_irq(errirq, shdev);
- unregister_die_notifier(&sh_dmae_nmi_notifier);
-
spin_lock_irqsave(&sh_dmae_lock, flags);
list_del_rcu(&shdev->node);
spin_unlock_irqrestore(&sh_dmae_lock, flags);
@@ -1296,6 +1287,11 @@ static struct platform_driver sh_dmae_driver = {
static int __init sh_dmae_init(void)
{
+ /* Wire up NMI handling */
+ int err = register_die_notifier(&sh_dmae_nmi_notifier);
+ if (err)
+ return err;
+
return platform_driver_probe(&sh_dmae_driver, sh_dmae_probe);
}
module_init(sh_dmae_init);
@@ -1303,6 +1299,8 @@ module_init(sh_dmae_init);
static void __exit sh_dmae_exit(void)
{
platform_driver_unregister(&sh_dmae_driver);
+
+ unregister_die_notifier(&sh_dmae_nmi_notifier);
}
module_exit(sh_dmae_exit);