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>
This commit is contained in:
parent
e37a769caa
commit
5f1af5c701
|
@ -146,12 +146,7 @@ EXPORT_SYMBOL(mbox_dsp_info);
|
||||||
static int __devinit omap1_mbox_probe(struct platform_device *pdev)
|
static int __devinit omap1_mbox_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
int ret;
|
||||||
if (pdev->num_resources != 2) {
|
|
||||||
dev_err(&pdev->dev, "invalid number of resources: %d\n",
|
|
||||||
pdev->num_resources);
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* MBOX base */
|
/* MBOX base */
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
|
@ -161,27 +156,32 @@ static int __devinit omap1_mbox_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
mbox_base = ioremap(res->start, resource_size(res));
|
mbox_base = ioremap(res->start, resource_size(res));
|
||||||
if (!mbox_base) {
|
if (!mbox_base)
|
||||||
dev_err(&pdev->dev, "ioremap failed\n");
|
return -ENOMEM;
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* DSP IRQ */
|
/* DSP IRQ */
|
||||||
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||||
if (unlikely(!res)) {
|
if (unlikely(!res)) {
|
||||||
dev_err(&pdev->dev, "invalid irq resource\n");
|
dev_err(&pdev->dev, "invalid irq resource\n");
|
||||||
iounmap(mbox_base);
|
ret = -ENODEV;
|
||||||
return -ENODEV;
|
goto err_out;
|
||||||
}
|
}
|
||||||
mbox_dsp_info.irq = res->start;
|
mbox_dsp_info.irq = res->start;
|
||||||
|
|
||||||
return omap_mbox_register(&pdev->dev, &mbox_dsp_info);
|
ret = omap_mbox_register(&pdev->dev, &mbox_dsp_info);
|
||||||
|
if (ret)
|
||||||
|
goto err_out;
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err_out:
|
||||||
|
iounmap(mbox_base);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devexit omap1_mbox_remove(struct platform_device *pdev)
|
static int __devexit omap1_mbox_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
omap_mbox_unregister(&mbox_dsp_info);
|
omap_mbox_unregister(&mbox_dsp_info);
|
||||||
|
iounmap(mbox_base);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue