Re: [PATCH] omap: mailbox: trivial cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 2, 2010 at 7:05 PM, Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
> @@ -419,7 +416,9 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)
>  #endif
>        return 0;
>
> +#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
>  err_iva1:
> +#endif
>        omap_mbox_unregister(&mbox_dsp_info);

Actually this seems to be wrong, shouldn't it be mbox_iva_info?

Perhaps this makes more sense:

--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -406,21 +406,18 @@ static int __devinit omap2_mbox_probe(struct
platform_device *pdev)
                if (unlikely(!res)) {
                        dev_err(&pdev->dev, "invalid irq resource\n");
                        ret = -ENODEV;
-                       goto err_iva1;
+                       goto err_dsp;
                }
                mbox_iva_info.irq = res->start;
                ret = omap_mbox_register(&pdev->dev, &mbox_iva_info);
-               if (ret)
-                       goto err_iva1;
+               if (ret) {
+                       omap_mbox_unregister(&mbox_iva_info);
+                       goto err_dsp;
+               }
        }
 #endif
        return 0;

-#if defined(CONFIG_ARCH_OMAP2420) /* IVA */
-err_iva1:
-       omap_mbox_unregister(&mbox_iva_info);
-#endif
-
 err_dsp:
        iounmap(mbox_base);
        return ret;

Although there's really no point in calling omap_mbox_unregister if
omap_mbox_register fails. And the probe() function returns error,
shouldn't all the previous registrations be removed?

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux