linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
To: Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: John Youn <John.Youn@synopsys.com>,
	Artur Petrosyan <Arthur.Petrosyan@synopsys.com>,
	Douglas Anderson <dianders@chromium.org>
Subject: [PATCH 15/15] usb: dwc2: Get rid of useless error checks in suspend interrupt
Date: Thu, 15 Apr 2021 09:41:21 +0400	[thread overview]
Message-ID: <016bc228ca270fae5cb2f41db23f22cd1ffccece.1618464534.git.Arthur.Petrosyan@synopsys.com> (raw)
In-Reply-To: <cover.1618464534.git.Arthur.Petrosyan@synopsys.com>

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.

Signed-off-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
---
 drivers/usb/dwc2/core.c      |  3 ---
 drivers/usb/dwc2/core_intr.c | 18 +++++++-----------
 2 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c
index 576c262dba55..6f70ab9577b4 100644
--- a/drivers/usb/dwc2/core.c
+++ b/drivers/usb/dwc2/core.c
@@ -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)
 {
-	if (hsotg->params.power_down != DWC2_POWER_DOWN_PARAM_HIBERNATION)
-		return -ENOTSUPP;
-
 	if (is_host)
 		return dwc2_host_enter_hibernation(hsotg);
 	else
diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c
index 470458ac664b..a5ab03808da6 100644
--- a/drivers/usb/dwc2/core_intr.c
+++ b/drivers/usb/dwc2/core_intr.c
@@ -535,13 +535,10 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
 			switch (hsotg->params.power_down) {
 			case DWC2_POWER_DOWN_PARAM_PARTIAL:
 				ret = dwc2_enter_partial_power_down(hsotg);
-				if (ret) {
-					if (ret != -ENOTSUPP)
-						dev_err(hsotg->dev,
-							"%s: enter partial_power_down failed\n",
-							__func__);
-					goto skip_power_saving;
-				}
+				if (ret)
+					dev_err(hsotg->dev,
+						"enter partial_power_down failed\n");
+
 				udelay(100);
 
 				/* Ask phy to be suspended */
@@ -550,10 +547,9 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
 				break;
 			case DWC2_POWER_DOWN_PARAM_HIBERNATION:
 				ret = dwc2_enter_hibernation(hsotg, 0);
-				if (ret && ret != -ENOTSUPP)
+				if (ret)
 					dev_err(hsotg->dev,
-						"%s: enter hibernation failed\n",
-						__func__);
+						"enter hibernation failed\n");
 				break;
 			case DWC2_POWER_DOWN_PARAM_NONE:
 				/*
@@ -562,7 +558,7 @@ static void dwc2_handle_usb_suspend_intr(struct dwc2_hsotg *hsotg)
 				 */
 				dwc2_gadget_enter_clock_gating(hsotg);
 			}
-skip_power_saving:
+
 			/*
 			 * Change to L2 (suspend) state before releasing
 			 * spinlock
-- 
2.25.1


  parent reply	other threads:[~2021-04-15  5:41 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1618464534.git.Arthur.Petrosyan@synopsys.com>
2021-04-15  5:39 ` [PATCH 01/15] usb: dwc2: Update exit hibernation when port reset is asserted Artur Petrosyan
2021-04-15  5:39 ` [PATCH 02/15] usb: dwc2: Reset DEVADDR after exiting gadget hibernation Artur Petrosyan
2021-04-15  5:39 ` [PATCH 03/15] usb: dwc2: Fix host mode hibernation exit with remote wakeup flow Artur Petrosyan
2021-04-15  5:39 ` [PATCH 04/15] usb: dwc2: Fix hibernation between host and device modes Artur Petrosyan
2021-04-15  5:40 ` [PATCH 05/15] usb: dwc2: Allow exiting hibernation from gpwrdn rst detect Artur Petrosyan
2021-04-15  5:40 ` [PATCH 06/15] usb: dwc2: Clear fifo_map when resetting core Artur Petrosyan
2021-04-15  5:40 ` [PATCH 07/15] usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated Artur Petrosyan
2021-04-15  5:40 ` [PATCH 08/15] usb: dwc2: Move enter hibernation to dwc2_port_suspend() function Artur Petrosyan
2021-04-15  5:40 ` [PATCH 09/15] usb: dwc2: Move exit hibernation to dwc2_port_resume() function Artur Petrosyan
2021-04-15  5:40 ` [PATCH 10/15] usb: dwc2: Allow exit hibernation in urb enqueue Artur Petrosyan
2021-04-15  9:12   ` Sergei Shtylyov
2021-04-16  5:43     ` Artur Petrosyan
2021-04-16  7:05       ` Artur Petrosyan
2021-04-15  5:40 ` [PATCH 11/15] usb: dwc2: Add hibernation entering flow by system suspend Artur Petrosyan
2021-04-15  5:40 ` [PATCH 12/15] usb: dwc2: Add hibernation exiting flow by system resume Artur Petrosyan
2021-04-15  5:41 ` [PATCH 13/15] usb: dwc2: Add exit hibernation mode before removing drive Artur Petrosyan
2021-04-15  9:24   ` Sergei Shtylyov
2021-04-16  5:46     ` Artur Petrosyan
2021-04-15  9:50   ` kernel test robot
2021-04-15 13:40   ` [kbuild] " Dan Carpenter
2021-04-15  5:41 ` [PATCH 14/15] usb: dwc2: Update dwc2_handle_usb_suspend_intr function Artur Petrosyan
2021-04-15  5:41 ` Artur Petrosyan [this message]
2021-04-16 12:46 ` [PATCH v2 00/15] usb: dwc2: Fix Hibernation issues Artur Petrosyan
2021-04-16 12:46 ` [PATCH v2 01/15] usb: dwc2: Update exit hibernation when port reset is asserted Artur Petrosyan
2021-04-19  7:30   ` Minas Harutyunyan
2021-04-16 12:46 ` [PATCH v2 02/15] usb: dwc2: Reset DEVADDR after exiting gadget hibernation Artur Petrosyan
2021-04-16 12:47 ` [PATCH v2 03/15] usb: dwc2: Fix host mode hibernation exit with remote wakeup flow Artur Petrosyan
2021-04-19  7:30   ` Minas Harutyunyan
2021-04-16 12:47 ` [PATCH v2 04/15] usb: dwc2: Fix hibernation between host and device modes Artur Petrosyan
2021-04-16 12:47 ` [PATCH v2 05/15] usb: dwc2: Allow exiting hibernation from gpwrdn rst detect Artur Petrosyan
2021-04-16 12:47 ` [PATCH v2 06/15] usb: dwc2: Clear fifo_map when resetting core Artur Petrosyan
2021-04-16 12:47 ` [PATCH v2 07/15] usb: dwc2: Clear GINTSTS_RESTOREDONE bit after restore is generated Artur Petrosyan
2021-04-16 12:47 ` [PATCH v2 08/15] usb: dwc2: Move enter hibernation to dwc2_port_suspend() function Artur Petrosyan
2021-04-19  7:31   ` Minas Harutyunyan
2021-04-16 12:47 ` [PATCH v2 09/15] usb: dwc2: Move exit hibernation to dwc2_port_resume() function Artur Petrosyan
2021-04-19  7:31   ` Minas Harutyunyan
2021-04-16 12:48 ` [PATCH v2 10/15] usb: dwc2: Allow exit hibernation in urb enqueue Artur Petrosyan
2021-04-19  7:31   ` Minas Harutyunyan
2021-04-16 12:48 ` [PATCH v2 11/15] usb: dwc2: Add hibernation entering flow by system suspend Artur Petrosyan
2021-04-19  7:31   ` Minas Harutyunyan
2021-04-16 12:48 ` [PATCH v2 12/15] usb: dwc2: Add hibernation exiting flow by system resume Artur Petrosyan
2021-04-19  7:31   ` Minas Harutyunyan
2021-04-16 12:48 ` [PATCH v2 13/15] usb: dwc2: Add exit hibernation mode before removing drive Artur Petrosyan
2021-04-19  7:32   ` Minas Harutyunyan
2021-04-16 12:48 ` [PATCH v2 14/15] usb: dwc2: Update dwc2_handle_usb_suspend_intr function Artur Petrosyan
2021-04-16 12:48 ` [PATCH v2 15/15] usb: dwc2: Get rid of useless error checks in suspend interrupt Artur Petrosyan
2021-04-19  7:32   ` Minas Harutyunyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=016bc228ca270fae5cb2f41db23f22cd1ffccece.1618464534.git.Arthur.Petrosyan@synopsys.com \
    --to=arthur.petrosyan@synopsys.com \
    --cc=John.Youn@synopsys.com \
    --cc=Minas.Harutyunyan@synopsys.com \
    --cc=balbi@kernel.org \
    --cc=dianders@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).