aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/mailbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/mailbox.c')
-rw-r--r--arch/arm/mach-omap1/mailbox.c28
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);
146static int __devinit omap1_mbox_probe(struct platform_device *pdev) 146static 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
176err_out:
177 iounmap(mbox_base);
178 return ret;
179} 179}
180 180
181static int __devexit omap1_mbox_remove(struct platform_device *pdev) 181static 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