diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2010-06-11 15:51:46 +0000 |
---|---|---|
committer | Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | 2010-08-04 15:50:19 +0300 |
commit | 9c80c8cd740f802eed27ed1c1334262b205bb8f5 (patch) | |
tree | d1cff1b65ad4bf7d79a059eefffd19e3d9343979 /arch/arm/mach-omap1/mailbox.c | |
parent | 898ee75623d5a151157e3f0dca12b0148051e2d6 (diff) | |
download | linux-9c80c8cd740f802eed27ed1c1334262b205bb8f5.tar.bz2 |
omap: mailbox: simplify omap_mbox_register()
No need to dynamically register mailboxes one by one.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Diffstat (limited to 'arch/arm/mach-omap1/mailbox.c')
-rw-r--r-- | arch/arm/mach-omap1/mailbox.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c index 0318754e8504..9ca0d58feadf 100644 --- a/arch/arm/mach-omap1/mailbox.c +++ b/arch/arm/mach-omap1/mailbox.c @@ -29,8 +29,6 @@ static void __iomem *mbox_base; -static struct omap_mbox **list; - struct omap_mbox1_fifo { unsigned long cmd; unsigned long data; @@ -151,9 +149,9 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev) struct resource *mem; int ret; int i; + struct omap_mbox **list; list = omap1_mboxes; - list[0]->irq = platform_get_irq_byname(pdev, "dsp"); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -161,27 +159,18 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev) if (!mbox_base) return -ENOMEM; - for (i = 0; list[i]; i++) { - ret = omap_mbox_register(&pdev->dev, list[i]); - if (ret) - goto err_out; + ret = omap_mbox_register(&pdev->dev, list); + if (ret) { + iounmap(mbox_base); + return ret; } - return 0; -err_out: - while (i--) - omap_mbox_unregister(list[i]); - iounmap(mbox_base); - return ret; + return 0; } static int __devexit omap1_mbox_remove(struct platform_device *pdev) { - int i; - - for (i = 0; list[i]; i++) - omap_mbox_unregister(list[i]); - + omap_mbox_unregister(); iounmap(mbox_base); return 0; } |