drivers/video: fsl-diu-fb: use a normal for-loop to uninstall framebuffers
authorTimur Tabi <timur@freescale.com>
Thu, 15 Sep 2011 21:44:56 +0000 (16:44 -0500)
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
Sun, 18 Sep 2011 20:08:57 +0000 (20:08 +0000)
Uninstalling the framebuffers in reverse order is unnecessary and makes
the for-loop awkward.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
drivers/video/fsl-diu-fb.c

index c66f6ed578863a4edcb0b4a266f7b44f2e559361..5137fbb6295feea13f64754fe2ec5f715e88ff83 100644 (file)
@@ -1543,9 +1543,9 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
        return 0;
 
 error:
-       for (i = ARRAY_SIZE(machine_data->fsl_diu_info);
-               i > 0; i--)
-               uninstall_fb(machine_data->fsl_diu_info[i - 1]);
+       for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
+               uninstall_fb(machine_data->fsl_diu_info[i]);
+
        if (pool.ad.vaddr)
                free_buf(&pdev->dev, &pool.ad,
                         sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
@@ -1575,8 +1575,8 @@ static int fsl_diu_remove(struct platform_device *pdev)
        machine_data = dev_get_drvdata(&pdev->dev);
        disable_lcdc(machine_data->fsl_diu_info[0]);
        free_irq_local(machine_data->irq);
-       for (i = ARRAY_SIZE(machine_data->fsl_diu_info); i > 0; i--)
-               uninstall_fb(machine_data->fsl_diu_info[i - 1]);
+       for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
+               uninstall_fb(machine_data->fsl_diu_info[i]);
        if (pool.ad.vaddr)
                free_buf(&pdev->dev, &pool.ad,
                         sizeof(struct diu_ad) * FSL_AOI_NUM, 8);