diff mbox

[v4,00/14] omap: mailbox: bunch of cleanups

Message ID 1276271509-11983-1-git-send-email-felipe.contreras@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Felipe Contreras June 11, 2010, 3:51 p.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c
index fdd6cc9..1a85a42 100644
--- a/arch/arm/mach-omap1/mailbox.c
+++ b/arch/arm/mach-omap1/mailbox.c
@@ -143,17 +143,16 @@  struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
 
 static int __devinit omap1_mbox_probe(struct platform_device *pdev)
 {
-       struct resource *res;
+       struct resource *mem;
        int ret;
        int i;
        struct omap_mbox **list;
 
-       res = pdev->resource;
-
        list = omap1_mboxes;
        list[0]->irq = platform_get_irq_byname(pdev, "dsp");
 
-       mbox_base = ioremap(res[0].start, resource_size(&res[0]));
+       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       mbox_base = ioremap(mem->start, resource_size(mem));
        if (!mbox_base)
                return -ENOMEM;
 
diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index d46e439..42dbfa4 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -388,13 +388,12 @@  struct omap_mbox *omap4_mboxes[] = { &mbox_1_info, &mbox_2_info, NULL };
 
 static int __devinit omap2_mbox_probe(struct platform_device *pdev)
 {
-       struct resource *res;
+       struct resource *mem;
        int ret;
        struct omap_mbox **list;
 
-       res = pdev->resource;
-
-       if (false);
+       if (false)
+               ;
 #if defined(CONFIG_ARCH_OMAP3430)
        else if (cpu_is_omap3430()) {
                list = omap3_mboxes;
@@ -423,7 +422,8 @@  static int __devinit omap2_mbox_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-       mbox_base = ioremap(res[0].start, resource_size(&res[0]));
+       mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       mbox_base = ioremap(mem->start, resource_size(mem));
        if (!mbox_base)
                return -ENOMEM;