Commit 0fdf3c5e authored by Artur Petrosyan's avatar Artur Petrosyan Committed by Greg Kroah-Hartman

usb: dwc2: Get rid of useless error checks in suspend interrupt

Squashed from Douglas Anderson's suggested commit
"usb: dwc2: Get rid of useless error checks for
hibernation/partial power down"

 - After this commit there should never be any
case where dwc2_enter_partial_power_down() and
dwc2_enter_hibernation() are called when
'params.power_down' is not correct.  Get rid of
the pile of error checking.

- As part of this cleanup some of the error messages
not to have __func__ in them.  That's not needed
for dev_err() calls since they already have the
device name as part of the message.
Acked-by: default avatarMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: default avatarArtur Petrosyan <Arthur.Petrosyan@synopsys.com>
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20210416124843.9EDCDA005D@mailhost.synopsys.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0112b7ce
...@@ -391,9 +391,6 @@ static bool dwc2_iddig_filter_enabled(struct dwc2_hsotg *hsotg) ...@@ -391,9 +391,6 @@ static bool dwc2_iddig_filter_enabled(struct dwc2_hsotg *hsotg)
*/ */
int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg, int is_host) int dwc2_enter_hibernation(struct dwc2_hsotg *hsotg, int is_host)
{ {
if (hsotg->params.power_down != DWC2_POWER_DOWN_PARAM_HIBERNATION)
return -ENOTSUPP;
if (is_host) if (is_host)
return dwc2_host_enter_hibernation(hsotg); return dwc2_host_enter_hibernation(hsotg);
else else
......
...@@ -535,13 +535,10 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg) ...@@ -535,13 +535,10 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
switch (hsotg->params.power_down) { switch (hsotg->params.power_down) {
case DWC2_POWER_DOWN_PARAM_PARTIAL: case DWC2_POWER_DOWN_PARAM_PARTIAL:
ret = dwc2_enter_partial_power_down(hsotg); ret = dwc2_enter_partial_power_down(hsotg);
if (ret) { if (ret)
if (ret != -ENOTSUPP) dev_err(hsotg->dev,
dev_err(hsotg->dev, "enter partial_power_down failed\n");
"%s: enter partial_power_down failed\n",
__func__);
goto skip_power_saving;
}
udelay(100); udelay(100);
/* Ask phy to be suspended */ /* Ask phy to be suspended */
...@@ -550,10 +547,9 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg) ...@@ -550,10 +547,9 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
break; break;
case DWC2_POWER_DOWN_PARAM_HIBERNATION: case DWC2_POWER_DOWN_PARAM_HIBERNATION:
ret = dwc2_enter_hibernation(hsotg, 0); ret = dwc2_enter_hibernation(hsotg, 0);
if (ret && ret != -ENOTSUPP) if (ret)
dev_err(hsotg->dev, dev_err(hsotg->dev,
"%s: enter hibernation failed\n", "enter hibernation failed\n");
__func__);
break; break;
case DWC2_POWER_DOWN_PARAM_NONE: case DWC2_POWER_DOWN_PARAM_NONE:
/* /*
...@@ -562,7 +558,7 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg) ...@@ -562,7 +558,7 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
*/ */
dwc2_gadget_enter_clock_gating(hsotg); dwc2_gadget_enter_clock_gating(hsotg);
} }
skip_power_saving:
/* /*
* Change to L2 (suspend) state before releasing * Change to L2 (suspend) state before releasing
* spinlock * spinlock
......
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