aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r--drivers/video/omap2/dss/dsi.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index d64ac3842884..bee92846cfab 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -365,11 +365,20 @@ struct platform_device *dsi_get_dsidev_from_id(int module)
365 struct omap_dss_output *out; 365 struct omap_dss_output *out;
366 enum omap_dss_output_id id; 366 enum omap_dss_output_id id;
367 367
368 id = module == 0 ? OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2; 368 switch (module) {
369 case 0:
370 id = OMAP_DSS_OUTPUT_DSI1;
371 break;
372 case 1:
373 id = OMAP_DSS_OUTPUT_DSI2;
374 break;
375 default:
376 return NULL;
377 }
369 378
370 out = omap_dss_get_output(id); 379 out = omap_dss_get_output(id);
371 380
372 return out->pdev; 381 return out ? out->pdev : NULL;
373} 382}
374 383
375static inline void dsi_write_reg(struct platform_device *dsidev, 384static inline void dsi_write_reg(struct platform_device *dsidev,