aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dsi.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-18 04:47:02 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-22 03:59:14 -0400
commitc6eee968d40d319f0ac7a8a63dcbc633d9e6a2ea (patch)
tree69c37f169f25f8fad858b032508d2a1c2cd5c8ea /drivers/video/omap2/dss/dsi.c
parent36377357db00f8660039578ba57a2a19bfc9ad3d (diff)
OMAPDSS: remove compiler warnings when CONFIG_BUG=n
If CONFIG_BUG is not enabled, BUG() does not stop the execution. Many places in code expect the execution to stop, and this causes compiler warnings about uninitialized variables and returning from a non-void function without a return value. This patch fixes the warnings by initializing the variables and returning properly after BUG() lines. However, the behaviour is still undefined after the BUG, but this is the choice the user makes when using CONFIG_BUG=n. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r--drivers/video/omap2/dss/dsi.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index f2d835fc4dc3..ec363d8390ed 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -446,6 +446,7 @@ u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt)
446 return 16; 446 return 16;
447 default: 447 default:
448 BUG(); 448 BUG();
449 return 0;
449 } 450 }
450} 451}
451 452
@@ -2003,6 +2004,7 @@ static unsigned dsi_get_line_buf_size(struct platform_device *dsidev)
2003 return 1365 * 3; /* 1365x24 bits */ 2004 return 1365 * 3; /* 1365x24 bits */
2004 default: 2005 default:
2005 BUG(); 2006 BUG();
2007 return 0;
2006 } 2008 }
2007} 2009}
2008 2010
@@ -2415,6 +2417,7 @@ static void dsi_config_tx_fifo(struct platform_device *dsidev,
2415 if (add + size > 4) { 2417 if (add + size > 4) {
2416 DSSERR("Illegal FIFO configuration\n"); 2418 DSSERR("Illegal FIFO configuration\n");
2417 BUG(); 2419 BUG();
2420 return;
2418 } 2421 }
2419 2422
2420 v = FLD_VAL(add, 2, 0) | FLD_VAL(size, 7, 4); 2423 v = FLD_VAL(add, 2, 0) | FLD_VAL(size, 7, 4);
@@ -2447,6 +2450,7 @@ static void dsi_config_rx_fifo(struct platform_device *dsidev,
2447 if (add + size > 4) { 2450 if (add + size > 4) {
2448 DSSERR("Illegal FIFO configuration\n"); 2451 DSSERR("Illegal FIFO configuration\n");
2449 BUG(); 2452 BUG();
2453 return;
2450 } 2454 }
2451 2455
2452 v = FLD_VAL(add, 2, 0) | FLD_VAL(size, 7, 4); 2456 v = FLD_VAL(add, 2, 0) | FLD_VAL(size, 7, 4);
@@ -2588,6 +2592,7 @@ static int dsi_sync_vc(struct platform_device *dsidev, int channel)
2588 return dsi_sync_vc_l4(dsidev, channel); 2592 return dsi_sync_vc_l4(dsidev, channel);
2589 default: 2593 default:
2590 BUG(); 2594 BUG();
2595 return -EINVAL;
2591 } 2596 }
2592} 2597}
2593 2598
@@ -3156,6 +3161,7 @@ static int dsi_vc_generic_send_read_request(struct omap_dss_device *dssdev,
3156 data = reqdata[0] | (reqdata[1] << 8); 3161 data = reqdata[0] | (reqdata[1] << 8);
3157 } else { 3162 } else {
3158 BUG(); 3163 BUG();
3164 return -EINVAL;
3159 } 3165 }
3160 3166
3161 r = dsi_vc_send_short(dsidev, channel, data_type, data, 0); 3167 r = dsi_vc_send_short(dsidev, channel, data_type, data, 0);
@@ -3270,7 +3276,6 @@ static int dsi_vc_read_rx_fifo(struct platform_device *dsidev, int channel,
3270 goto err; 3276 goto err;
3271 } 3277 }
3272 3278
3273 BUG();
3274err: 3279err:
3275 DSSERR("dsi_vc_read_rx_fifo(ch %d type %s) failed\n", channel, 3280 DSSERR("dsi_vc_read_rx_fifo(ch %d type %s) failed\n", channel,
3276 type == DSS_DSI_CONTENT_GENERIC ? "GENERIC" : "DCS"); 3281 type == DSS_DSI_CONTENT_GENERIC ? "GENERIC" : "DCS");
@@ -3879,6 +3884,7 @@ static int dsi_proto_config(struct omap_dss_device *dssdev)
3879 break; 3884 break;
3880 default: 3885 default:
3881 BUG(); 3886 BUG();
3887 return -EINVAL;
3882 } 3888 }
3883 3889
3884 r = dsi_read_reg(dsidev, DSI_CTRL); 3890 r = dsi_read_reg(dsidev, DSI_CTRL);
@@ -4119,6 +4125,7 @@ int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel)
4119 break; 4125 break;
4120 default: 4126 default:
4121 BUG(); 4127 BUG();
4128 return -EINVAL;
4122 }; 4129 };
4123 4130
4124 dsi_if_enable(dsidev, false); 4131 dsi_if_enable(dsidev, false);