aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/mailbox.c
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2010-06-11 11:51:46 -0400
committerHiroshi DOYU <Hiroshi.DOYU@nokia.com>2010-08-04 08:50:19 -0400
commit9c80c8cd740f802eed27ed1c1334262b205bb8f5 (patch)
treed1cff1b65ad4bf7d79a059eefffd19e3d9343979 /arch/arm/mach-omap2/mailbox.c
parent898ee75623d5a151157e3f0dca12b0148051e2d6 (diff)
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-omap2/mailbox.c')
-rw-r--r--arch/arm/mach-omap2/mailbox.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index e5abc8e42f52..55d8b77f0fc0 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -56,8 +56,6 @@
56 56
57static void __iomem *mbox_base; 57static void __iomem *mbox_base;
58 58
59static struct omap_mbox **list;
60
61struct omap_mbox2_fifo { 59struct omap_mbox2_fifo {
62 unsigned long msg; 60 unsigned long msg;
63 unsigned long fifo_stat; 61 unsigned long fifo_stat;
@@ -390,7 +388,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
390{ 388{
391 struct resource *mem; 389 struct resource *mem;
392 int ret; 390 int ret;
393 int i; 391 struct omap_mbox **list;
394 392
395 if (cpu_is_omap3430()) { 393 if (cpu_is_omap3430()) {
396 list = omap3_mboxes; 394 list = omap3_mboxes;
@@ -421,27 +419,19 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
421 if (!mbox_base) 419 if (!mbox_base)
422 return -ENOMEM; 420 return -ENOMEM;
423 421
424 for (i = 0; list[i]; i++) { 422 ret = omap_mbox_register(&pdev->dev, list);
425 ret = omap_mbox_register(&pdev->dev, list[i]); 423 if (ret) {
426 if (ret) 424 iounmap(mbox_base);
427 goto err_out; 425 return ret;
428 } 426 }
429 return 0; 427 return 0;
430 428
431err_out:
432 while (i--)
433 omap_mbox_unregister(list[i]);
434 iounmap(mbox_base);
435 return ret; 429 return ret;
436} 430}
437 431
438static int __devexit omap2_mbox_remove(struct platform_device *pdev) 432static int __devexit omap2_mbox_remove(struct platform_device *pdev)
439{ 433{
440 int i; 434 omap_mbox_unregister();
441
442 for (i = 0; list[i]; i++)
443 omap_mbox_unregister(list[i]);
444
445 iounmap(mbox_base); 435 iounmap(mbox_base);
446 return 0; 436 return 0;
447} 437}