Commit 929aea09 authored by Matthijs Kooijman's avatar Matthijs Kooijman Committed by Greg Kroah-Hartman

staging: dwc2: replace some magic numbers by constants

There were already macros for these, they just weren't being used in a
few places.
Signed-off-by: default avatarMatthijs Kooijman <matthijs@stdin.nl>
Acked-by: default avatarPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 438492ab
...@@ -1696,7 +1696,7 @@ u32 dwc2_calc_frame_interval(struct dwc2_hsotg *hsotg) ...@@ -1696,7 +1696,7 @@ u32 dwc2_calc_frame_interval(struct dwc2_hsotg *hsotg)
GHWCFG2_FS_PHY_TYPE_DEDICATED) GHWCFG2_FS_PHY_TYPE_DEDICATED)
clock = 48; clock = 48;
if ((hprt0 & HPRT0_SPD_MASK) == 0) if ((hprt0 & HPRT0_SPD_MASK) == HPRT0_SPD_HIGH_SPEED)
/* High speed case */ /* High speed case */
return 125 * clock; return 125 * clock;
else else
...@@ -2298,7 +2298,7 @@ int dwc2_set_param_phy_type(struct dwc2_hsotg *hsotg, int val) ...@@ -2298,7 +2298,7 @@ int dwc2_set_param_phy_type(struct dwc2_hsotg *hsotg, int val)
#ifndef NO_FS_PHY_HW_CHECKS #ifndef NO_FS_PHY_HW_CHECKS
valid = 0; valid = 0;
#else #else
val = 0; val = DWC2_PHY_TYPE_PARAM_FS;
dev_dbg(hsotg->dev, "Setting phy_type to %d\n", val); dev_dbg(hsotg->dev, "Setting phy_type to %d\n", val);
retval = -EINVAL; retval = -EINVAL;
#endif #endif
...@@ -2325,7 +2325,7 @@ int dwc2_set_param_phy_type(struct dwc2_hsotg *hsotg, int val) ...@@ -2325,7 +2325,7 @@ int dwc2_set_param_phy_type(struct dwc2_hsotg *hsotg, int val)
dev_err(hsotg->dev, dev_err(hsotg->dev,
"%d invalid for phy_type. Check HW configuration.\n", "%d invalid for phy_type. Check HW configuration.\n",
val); val);
val = 0; val = DWC2_PHY_TYPE_PARAM_FS;
if (hs_phy_type != GHWCFG2_HS_PHY_TYPE_NOT_SUPPORTED) { if (hs_phy_type != GHWCFG2_HS_PHY_TYPE_NOT_SUPPORTED) {
if (hs_phy_type == GHWCFG2_HS_PHY_TYPE_UTMI || if (hs_phy_type == GHWCFG2_HS_PHY_TYPE_UTMI ||
hs_phy_type == GHWCFG2_HS_PHY_TYPE_UTMI_ULPI) hs_phy_type == GHWCFG2_HS_PHY_TYPE_UTMI_ULPI)
...@@ -2360,8 +2360,8 @@ int dwc2_set_param_speed(struct dwc2_hsotg *hsotg, int val) ...@@ -2360,8 +2360,8 @@ int dwc2_set_param_speed(struct dwc2_hsotg *hsotg, int val)
valid = 0; valid = 0;
} }
if (val == 0 && dwc2_get_param_phy_type(hsotg) == if (val == DWC2_SPEED_PARAM_HIGH &&
DWC2_PHY_TYPE_PARAM_FS) dwc2_get_param_phy_type(hsotg) == DWC2_PHY_TYPE_PARAM_FS)
valid = 0; valid = 0;
if (!valid) { if (!valid) {
...@@ -2370,7 +2370,7 @@ int dwc2_set_param_speed(struct dwc2_hsotg *hsotg, int val) ...@@ -2370,7 +2370,7 @@ int dwc2_set_param_speed(struct dwc2_hsotg *hsotg, int val)
"%d invalid for speed parameter. Check HW configuration.\n", "%d invalid for speed parameter. Check HW configuration.\n",
val); val);
val = dwc2_get_param_phy_type(hsotg) == DWC2_PHY_TYPE_PARAM_FS ? val = dwc2_get_param_phy_type(hsotg) == DWC2_PHY_TYPE_PARAM_FS ?
1 : 0; DWC2_SPEED_PARAM_FULL : DWC2_SPEED_PARAM_HIGH;
dev_dbg(hsotg->dev, "Setting speed to %d\n", val); dev_dbg(hsotg->dev, "Setting speed to %d\n", val);
retval = -EINVAL; retval = -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment