aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-12-11 07:11:52 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-27 14:35:11 -0500
commitf7c3f5ce17a135610b114a17e917b5a53c4d07c4 (patch)
tree9cd04205838cdb8f79fb3c0b71be1408fc94682e /drivers
parent21a73397c0cea688a37c532d1029fc8ecbd88fc6 (diff)
[media] omap3isp: csiphy: Fix an uninitialized variable compiler warning
drivers/media/platform/omap3isp/ispcsiphy.c: In function ‘csiphy_routing_cfg’: drivers/media/platform/omap3isp/ispcsiphy.c:71:57: warning: ‘shift’ may be used uninitialized in this function [-Wuninitialized] drivers/media/platform/omap3isp/ispcsiphy.c:40:6: note: ‘shift’ was declared here The warning is a false positive but the compiler is right in complaining. Fix it by using the correct enum data type for the iface argument and adding a default case in the switch statement. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/omap3isp/ispcsiphy.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/platform/omap3isp/ispcsiphy.c b/drivers/media/platform/omap3isp/ispcsiphy.c
index 3d56b33f85e8..c09de32f986a 100644
--- a/drivers/media/platform/omap3isp/ispcsiphy.c
+++ b/drivers/media/platform/omap3isp/ispcsiphy.c
@@ -32,7 +32,8 @@
32#include "ispreg.h" 32#include "ispreg.h"
33#include "ispcsiphy.h" 33#include "ispcsiphy.h"
34 34
35static void csiphy_routing_cfg_3630(struct isp_csiphy *phy, u32 iface, 35static void csiphy_routing_cfg_3630(struct isp_csiphy *phy,
36 enum isp_interface_type iface,
36 bool ccp2_strobe) 37 bool ccp2_strobe)
37{ 38{
38 u32 reg = isp_reg_readl( 39 u32 reg = isp_reg_readl(
@@ -40,6 +41,8 @@ static void csiphy_routing_cfg_3630(struct isp_csiphy *phy, u32 iface,
40 u32 shift, mode; 41 u32 shift, mode;
41 42
42 switch (iface) { 43 switch (iface) {
44 default:
45 /* Should not happen in practice, but let's keep the compiler happy. */
43 case ISP_INTERFACE_CCP2B_PHY1: 46 case ISP_INTERFACE_CCP2B_PHY1:
44 reg &= ~OMAP3630_CONTROL_CAMERA_PHY_CTRL_CSI1_RX_SEL_PHY2; 47 reg &= ~OMAP3630_CONTROL_CAMERA_PHY_CTRL_CSI1_RX_SEL_PHY2;
45 shift = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY1_SHIFT; 48 shift = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_PHY1_SHIFT;
@@ -59,9 +62,8 @@ static void csiphy_routing_cfg_3630(struct isp_csiphy *phy, u32 iface,
59 } 62 }
60 63
61 /* Select data/clock or data/strobe mode for CCP2 */ 64 /* Select data/clock or data/strobe mode for CCP2 */
62 switch (iface) { 65 if (iface == ISP_INTERFACE_CCP2B_PHY1 ||
63 case ISP_INTERFACE_CCP2B_PHY1: 66 iface == ISP_INTERFACE_CCP2B_PHY2) {
64 case ISP_INTERFACE_CCP2B_PHY2:
65 if (ccp2_strobe) 67 if (ccp2_strobe)
66 mode = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_CCP2_DATA_STROBE; 68 mode = OMAP3630_CONTROL_CAMERA_PHY_CTRL_CAMMODE_CCP2_DATA_STROBE;
67 else 69 else
@@ -110,7 +112,8 @@ static void csiphy_routing_cfg_3430(struct isp_csiphy *phy, u32 iface, bool on,
110 * and 3630, so they will not hold their contents in off-mode. This isn't an 112 * and 3630, so they will not hold their contents in off-mode. This isn't an
111 * issue since the MPU power domain is forced on whilst the ISP is in use. 113 * issue since the MPU power domain is forced on whilst the ISP is in use.
112 */ 114 */
113static void csiphy_routing_cfg(struct isp_csiphy *phy, u32 iface, bool on, 115static void csiphy_routing_cfg(struct isp_csiphy *phy,
116 enum isp_interface_type iface, bool on,
114 bool ccp2_strobe) 117 bool ccp2_strobe)
115{ 118{
116 if (phy->isp->mmio_base[OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL] 119 if (phy->isp->mmio_base[OMAP3_ISP_IOMEM_3630_CONTROL_CAMERA_PHY_CTRL]