Skip to content

Commit

Permalink
drivers/video: fsl-diu-fb: use a normal for-loop to uninstall framebu…
Browse files Browse the repository at this point in the history
…ffers

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>
  • Loading branch information
Timur Tabi authored and Florian Tobias Schandinat committed Sep 18, 2011
1 parent 589c797 commit 3f78bbd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/video/fsl-diu-fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 3f78bbd

Please sign in to comment.