diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2010-06-11 11:51:46 -0400 |
---|---|---|
committer | Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | 2010-08-04 08:50:19 -0400 |
commit | 9c80c8cd740f802eed27ed1c1334262b205bb8f5 (patch) | |
tree | d1cff1b65ad4bf7d79a059eefffd19e3d9343979 /arch/arm/mach-omap1/mailbox.c | |
parent | 898ee75623d5a151157e3f0dca12b0148051e2d6 (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-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 @@ | |||
29 | 29 | ||
30 | static void __iomem *mbox_base; | 30 | static void __iomem *mbox_base; |
31 | 31 | ||
32 | static struct omap_mbox **list; | ||
33 | |||
34 | struct omap_mbox1_fifo { | 32 | struct omap_mbox1_fifo { |
35 | unsigned long cmd; | 33 | unsigned long cmd; |
36 | unsigned long data; | 34 | unsigned long data; |
@@ -151,9 +149,9 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev) | |||
151 | struct resource *mem; | 149 | struct resource *mem; |
152 | int ret; | 150 | int ret; |
153 | int i; | 151 | int i; |
152 | struct omap_mbox **list; | ||
154 | 153 | ||
155 | list = omap1_mboxes; | 154 | list = omap1_mboxes; |
156 | |||
157 | list[0]->irq = platform_get_irq_byname(pdev, "dsp"); | 155 | list[0]->irq = platform_get_irq_byname(pdev, "dsp"); |
158 | 156 | ||
159 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 157 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -161,27 +159,18 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev) | |||
161 | if (!mbox_base) | 159 | if (!mbox_base) |
162 | return -ENOMEM; | 160 | return -ENOMEM; |
163 | 161 | ||
164 | for (i = 0; list[i]; i++) { | 162 | ret = omap_mbox_register(&pdev->dev, list); |
165 | ret = omap_mbox_register(&pdev->dev, list[i]); | 163 | if (ret) { |
166 | if (ret) | 164 | iounmap(mbox_base); |
167 | goto err_out; | 165 | return ret; |
168 | } | 166 | } |
169 | return 0; | ||
170 | 167 | ||
171 | err_out: | 168 | return 0; |
172 | while (i--) | ||
173 | omap_mbox_unregister(list[i]); | ||
174 | iounmap(mbox_base); | ||
175 | return ret; | ||
176 | } | 169 | } |
177 | 170 | ||
178 | static int __devexit omap1_mbox_remove(struct platform_device *pdev) | 171 | static int __devexit omap1_mbox_remove(struct platform_device *pdev) |
179 | { | 172 | { |
180 | int i; | 173 | omap_mbox_unregister(); |
181 | |||
182 | for (i = 0; list[i]; i++) | ||
183 | omap_mbox_unregister(list[i]); | ||
184 | |||
185 | iounmap(mbox_base); | 174 | iounmap(mbox_base); |
186 | return 0; | 175 | return 0; |
187 | } | 176 | } |