summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/usb_phy.c
diff options
context:
space:
mode:
authorScott Williams <scwilliams@nvidia.com>2011-04-18 12:46:48 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-04-26 15:55:58 -0700
commit86ce6c7920d96709e69ce7ce52d9c0b3d106e35c (patch)
tree7396a3cd33ad9ed052b34c3dde11cecfc860f093 /arch/arm/mach-tegra/usb_phy.c
parent74c7ab12a48d0f56d75ca711e3b3e38e0e61e5c8 (diff)
ARM: tegra: usb: Fix compiler warnings
Fix "initialization from incompatible pointer type" warnings due to a mixure of void and non-void functions used as initializers for arrays of type tegra_phy_fp[]. All functions of type tegra_phy_fp now uniformly return a status. Original-Change-Id: I2fa80d329817ab6dffd789a34fc5dc3baca7dbff Reviewed-on: http://git-master/r/28088 Tested-by: Scott Williams <scwilliams@nvidia.com> Reviewed-by: Szming Lin <stlin@nvidia.com> Reviewed-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Change-Id: I5515a933c850b4e51315a3791cab6e0b81bc8444
Diffstat (limited to 'arch/arm/mach-tegra/usb_phy.c')
-rw-r--r--arch/arm/mach-tegra/usb_phy.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index 46c78e3a41f3..361f32beb0ce 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -485,7 +485,7 @@ static void utmip_pad_close(struct tegra_usb_phy *phy)
clk_put(phy->pad_clk);
}
-static void utmip_pad_power_on(struct tegra_usb_phy *phy)
+static int utmip_pad_power_on(struct tegra_usb_phy *phy)
{
unsigned long val, flags;
void __iomem *base = phy->pad_regs;
@@ -503,6 +503,8 @@ static void utmip_pad_power_on(struct tegra_usb_phy *phy)
spin_unlock_irqrestore(&utmip_pad_lock, flags);
clk_disable(phy->pad_clk);
+
+ return 0;
}
static int utmip_pad_power_off(struct tegra_usb_phy *phy)
@@ -806,7 +808,7 @@ static int utmi_phy_power_on(struct tegra_usb_phy *phy)
return 0;
}
-static void utmi_phy_power_off(struct tegra_usb_phy *phy)
+static int utmi_phy_power_off(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
@@ -848,9 +850,11 @@ static void utmi_phy_power_off(struct tegra_usb_phy *phy)
writel(val, base + UTMIP_BIAS_CFG1);
#endif
utmip_pad_power_off(phy);
+
+ return 0;
}
-static void utmi_phy_preresume(struct tegra_usb_phy *phy)
+static int utmi_phy_preresume(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
@@ -858,9 +862,11 @@ static void utmi_phy_preresume(struct tegra_usb_phy *phy)
val = readl(base + UTMIP_TX_CFG0);
val |= UTMIP_HS_DISCON_DISABLE;
writel(val, base + UTMIP_TX_CFG0);
+
+ return 0;
}
-static void utmi_phy_postresume(struct tegra_usb_phy *phy)
+static int utmi_phy_postresume(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
@@ -868,6 +874,8 @@ static void utmi_phy_postresume(struct tegra_usb_phy *phy)
val = readl(base + UTMIP_TX_CFG0);
val &= ~UTMIP_HS_DISCON_DISABLE;
writel(val, base + UTMIP_TX_CFG0);
+
+ return 0;
}
static void uhsic_phy_postresume(struct tegra_usb_phy *phy)
@@ -1003,7 +1011,7 @@ static int ulpi_phy_power_on(struct tegra_usb_phy *phy)
return 0;
}
-static void ulpi_phy_power_off(struct tegra_usb_phy *phy)
+static int ulpi_phy_power_off(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
@@ -1026,6 +1034,8 @@ static void ulpi_phy_power_off(struct tegra_usb_phy *phy)
gpio_direction_output(config->reset_gpio, 0);
#endif
clk_disable(phy->clk);
+
+ return 0;
}
static int null_phy_power_on(struct tegra_usb_phy *phy)
@@ -1122,7 +1132,7 @@ static int null_phy_power_on(struct tegra_usb_phy *phy)
return 0;
}
-static void null_phy_power_off(struct tegra_usb_phy *phy)
+static int null_phy_power_off(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
@@ -1130,9 +1140,11 @@ static void null_phy_power_off(struct tegra_usb_phy *phy)
val = readl(base + ULPI_TIMING_CTRL_0);
val &= ~ULPI_CLK_PADOUT_ENA;
writel(val, base + ULPI_TIMING_CTRL_0);
+
+ return 0;
}
-static void null_phy_post_usbcmd_reset(struct tegra_usb_phy *phy)
+static int null_phy_post_usbcmd_reset(struct tegra_usb_phy *phy)
{
#ifdef CONFIG_ARCH_TEGRA_3x_SOC
unsigned long val;
@@ -1157,6 +1169,7 @@ static void null_phy_post_usbcmd_reset(struct tegra_usb_phy *phy)
val &= ~ULPIS2S_SLV0_CLAMP_XMIT;
writel(val, base + ULPIS2S_CTRL);
#endif
+ return 0;
}
static int uhsic_phy_power_on(struct tegra_usb_phy *phy)
@@ -1237,12 +1250,13 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *phy)
if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID,
USB_PHY_CLK_VALID)) {
pr_err("%s: timeout waiting for phy to stabilize\n", __func__);
+ return -ETIMEDOUT;
}
return 0;
}
-static void uhsic_phy_power_off(struct tegra_usb_phy *phy)
+static int uhsic_phy_power_off(struct tegra_usb_phy *phy)
{
unsigned long val;
void __iomem *base = phy->regs;
@@ -1261,6 +1275,7 @@ static void uhsic_phy_power_off(struct tegra_usb_phy *phy)
val &= ~UHSIC_PHY_ENABLE;
writel(val, base + USB_SUSP_CTRL);
+ return 0;
}
#ifdef CONFIG_USB_TEGRA_OTG
@@ -1419,6 +1434,8 @@ err0:
int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
{
+ int ret = 0;
+
const tegra_phy_fp power_on[] = {
utmi_phy_power_on,
ulpi_phy_power_on,
@@ -1432,9 +1449,9 @@ int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
}
if (power_on[phy->usb_phy_type])
- return power_on[phy->usb_phy_type](phy);
+ ret = power_on[phy->usb_phy_type](phy);
- return 0;
+ return ret;
}
void tegra_usb_phy_power_off(struct tegra_usb_phy *phy)