diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-07 08:44:30 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-18 09:15:03 -0400 |
commit | 47eb6763ff63126e34785be0ea5f365180595024 (patch) | |
tree | 011f05a72dfe3ab10e1a2b566f5cf3562cf0f6a1 /drivers/video | |
parent | bcb226a9254d30c0c44bc724c22b7a5d3fadec6a (diff) |
OMAPDSS: handle errors in dss_init_device
Add error handling to dss_init_device(), which has, for some reason,
been missing.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/dss/core.c | 4 | ||||
-rw-r--r-- | drivers/video/omap2/dss/display.c | 23 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 2 |
3 files changed, 22 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 315f557f1d1a..9315ece90ff1 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -358,7 +358,9 @@ static int dss_driver_probe(struct device *dev) | |||
358 | dev_name(dev), dssdev->driver_name, | 358 | dev_name(dev), dssdev->driver_name, |
359 | dssdrv->driver.name); | 359 | dssdrv->driver.name); |
360 | 360 | ||
361 | dss_init_device(core.pdev, dssdev); | 361 | r = dss_init_device(core.pdev, dssdev); |
362 | if (r) | ||
363 | return r; | ||
362 | 364 | ||
363 | force = core.default_display_name && | 365 | force = core.default_display_name && |
364 | strcmp(core.default_display_name, dssdev->name) == 0; | 366 | strcmp(core.default_display_name, dssdev->name) == 0; |
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c index 5f09d503d619..f7190109bd91 100644 --- a/drivers/video/omap2/dss/display.c +++ b/drivers/video/omap2/dss/display.c | |||
@@ -320,26 +320,39 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev, | |||
320 | } | 320 | } |
321 | EXPORT_SYMBOL(omapdss_default_get_timings); | 321 | EXPORT_SYMBOL(omapdss_default_get_timings); |
322 | 322 | ||
323 | void dss_init_device(struct platform_device *pdev, | 323 | int dss_init_device(struct platform_device *pdev, |
324 | struct omap_dss_device *dssdev) | 324 | struct omap_dss_device *dssdev) |
325 | { | 325 | { |
326 | struct device_attribute *attr; | 326 | struct device_attribute *attr; |
327 | int i; | 327 | int i, r; |
328 | int r; | ||
329 | 328 | ||
330 | /* create device sysfs files */ | 329 | /* create device sysfs files */ |
331 | i = 0; | 330 | i = 0; |
332 | while ((attr = display_sysfs_attrs[i++]) != NULL) { | 331 | while ((attr = display_sysfs_attrs[i++]) != NULL) { |
333 | r = device_create_file(&dssdev->dev, attr); | 332 | r = device_create_file(&dssdev->dev, attr); |
334 | if (r) | 333 | if (r) { |
334 | for (i = i - 2; i >= 0; i--) { | ||
335 | attr = display_sysfs_attrs[i]; | ||
336 | device_remove_file(&dssdev->dev, attr); | ||
337 | } | ||
338 | |||
335 | DSSERR("failed to create sysfs file\n"); | 339 | DSSERR("failed to create sysfs file\n"); |
340 | return r; | ||
341 | } | ||
336 | } | 342 | } |
337 | 343 | ||
338 | /* create display? sysfs links */ | 344 | /* create display? sysfs links */ |
339 | r = sysfs_create_link(&pdev->dev.kobj, &dssdev->dev.kobj, | 345 | r = sysfs_create_link(&pdev->dev.kobj, &dssdev->dev.kobj, |
340 | dev_name(&dssdev->dev)); | 346 | dev_name(&dssdev->dev)); |
341 | if (r) | 347 | if (r) { |
348 | while ((attr = display_sysfs_attrs[i++]) != NULL) | ||
349 | device_remove_file(&dssdev->dev, attr); | ||
350 | |||
342 | DSSERR("failed to create sysfs display link\n"); | 351 | DSSERR("failed to create sysfs display link\n"); |
352 | return r; | ||
353 | } | ||
354 | |||
355 | return 0; | ||
343 | } | 356 | } |
344 | 357 | ||
345 | void dss_uninit_device(struct platform_device *pdev, | 358 | void dss_uninit_device(struct platform_device *pdev, |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index a977826d850c..98e82731c60a 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -228,7 +228,7 @@ int dss_suspend_all_devices(void); | |||
228 | int dss_resume_all_devices(void); | 228 | int dss_resume_all_devices(void); |
229 | void dss_disable_all_devices(void); | 229 | void dss_disable_all_devices(void); |
230 | 230 | ||
231 | void dss_init_device(struct platform_device *pdev, | 231 | int dss_init_device(struct platform_device *pdev, |
232 | struct omap_dss_device *dssdev); | 232 | struct omap_dss_device *dssdev); |
233 | void dss_uninit_device(struct platform_device *pdev, | 233 | void dss_uninit_device(struct platform_device *pdev, |
234 | struct omap_dss_device *dssdev); | 234 | struct omap_dss_device *dssdev); |