From b3f91eb8d8d17ad3ca5da4fa9f20d2e46133fd99 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Wed, 17 Feb 2010 12:00:01 +0200 Subject: OMAP: DSS2: OMAPFB: fix dssdev cleanup on error If there was a dss device without a driver and thus omapfb probe failed, ref counts could be left to dss devices. Signed-off-by: Tomi Valkeinen diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index d17caef..973bf79 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -2111,18 +2111,23 @@ static int omapfb_probe(struct platform_device *pdev) fbdev->dev = &pdev->dev; platform_set_drvdata(pdev, fbdev); + r = 0; fbdev->num_displays = 0; dssdev = NULL; for_each_dss_dev(dssdev) { omap_dss_get_device(dssdev); + if (!dssdev->driver) { dev_err(&pdev->dev, "no driver for display\n"); - r = -EINVAL; - goto cleanup; + r = -ENODEV; } + fbdev->displays[fbdev->num_displays++] = dssdev; } + if (r) + goto cleanup; + if (fbdev->num_displays == 0) { dev_err(&pdev->dev, "no displays\n"); r = -EINVAL; -- cgit v0.10.2