diff options
author | Felipe Contreras <felipe.contreras@gmail.com> | 2010-06-11 11:51:41 -0400 |
---|---|---|
committer | Hiroshi DOYU <Hiroshi.DOYU@nokia.com> | 2010-08-04 08:50:18 -0400 |
commit | 5f1af5c7013b8fde5b92cb4d356dfafa78284951 (patch) | |
tree | f3f46311dda282596d7be2c66320652f3aaa73c8 /arch/arm | |
parent | e37a769caa6bd4348986d863a99736b61adc5b4c (diff) |
omap: mailbox: update omap1 probing
Based on omap2 code.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@nokia.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap1/mailbox.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c index 15bf2a29bbcd..211b9fcbe7c8 100644 --- a/arch/arm/mach-omap1/mailbox.c +++ b/arch/arm/mach-omap1/mailbox.c | |||
@@ -146,12 +146,7 @@ EXPORT_SYMBOL(mbox_dsp_info); | |||
146 | static int __devinit omap1_mbox_probe(struct platform_device *pdev) | 146 | static int __devinit omap1_mbox_probe(struct platform_device *pdev) |
147 | { | 147 | { |
148 | struct resource *res; | 148 | struct resource *res; |
149 | 149 | int ret; | |
150 | if (pdev->num_resources != 2) { | ||
151 | dev_err(&pdev->dev, "invalid number of resources: %d\n", | ||
152 | pdev->num_resources); | ||
153 | return -ENODEV; | ||
154 | } | ||
155 | 150 | ||
156 | /* MBOX base */ | 151 | /* MBOX base */ |
157 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 152 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
@@ -161,27 +156,32 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev) | |||
161 | } | 156 | } |
162 | 157 | ||
163 | mbox_base = ioremap(res->start, resource_size(res)); | 158 | mbox_base = ioremap(res->start, resource_size(res)); |
164 | if (!mbox_base) { | 159 | if (!mbox_base) |
165 | dev_err(&pdev->dev, "ioremap failed\n"); | 160 | return -ENOMEM; |
166 | return -ENODEV; | ||
167 | } | ||
168 | 161 | ||
169 | /* DSP IRQ */ | 162 | /* DSP IRQ */ |
170 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 163 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
171 | if (unlikely(!res)) { | 164 | if (unlikely(!res)) { |
172 | dev_err(&pdev->dev, "invalid irq resource\n"); | 165 | dev_err(&pdev->dev, "invalid irq resource\n"); |
173 | iounmap(mbox_base); | 166 | ret = -ENODEV; |
174 | return -ENODEV; | 167 | goto err_out; |
175 | } | 168 | } |
176 | mbox_dsp_info.irq = res->start; | 169 | mbox_dsp_info.irq = res->start; |
177 | 170 | ||
178 | return omap_mbox_register(&pdev->dev, &mbox_dsp_info); | 171 | ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info); |
172 | if (ret) | ||
173 | goto err_out; | ||
174 | return 0; | ||
175 | |||
176 | err_out: | ||
177 | iounmap(mbox_base); | ||
178 | return ret; | ||
179 | } | 179 | } |
180 | 180 | ||
181 | static int __devexit omap1_mbox_remove(struct platform_device *pdev) | 181 | static int __devexit omap1_mbox_remove(struct platform_device *pdev) |
182 | { | 182 | { |
183 | omap_mbox_unregister(&mbox_dsp_info); | 183 | omap_mbox_unregister(&mbox_dsp_info); |
184 | 184 | iounmap(mbox_base); | |
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
187 | 187 | ||