public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: <guo.ziliang@zte.com.cn>
To: <thinh.nguyen@synopsys.com>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<guo.ziliang@zte.com.cn>
Subject: [PATCH linux-next] usb: dwc3: gadget: remove redundant ret variable in dwc3_gadget_vbus_draw
Date: Thu, 17 Nov 2022 09:53:31 +0800 (CST)	[thread overview]
Message-ID: <202211170953310238773@zte.com.cn> (raw)

From: guo ziliang <guo.ziliang@zte.com.cn>
Return value from dwc3_gadget_vbus_draw() directly instead of taking
this in another redundant variable.

Signed-off-by: guo ziliang <guo.ziliang@zte.com.cn>
---
 drivers/usb/dwc3/gadget.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index faf37c6..d984d68 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2904,7 +2904,6 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned int mA)
 {
        struct dwc3             *dwc = gadget_to_dwc(g);
        union power_supply_propval      val = {0};
-       int                             ret;

        if (dwc->usb2_phy)
                return usb_phy_set_power(dwc->usb2_phy, mA);
@@ -2913,9 +2912,7 @@ static int dwc3_gadget_vbus_draw(struct usb_gadget *g, unsigned int mA)
                return -EOPNOTSUPP;

        val.intval = 1000 * mA;
-       ret = power_supply_set_property(dwc->usb_psy, POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &val);
-
-       return ret;
+       return power_supply_set_property(dwc->usb_psy, POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, &val);
 }

 /**
--
1.8.3.1

             reply	other threads:[~2022-11-17  1:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  1:53 guo.ziliang [this message]
2022-11-18  0:40 ` [PATCH linux-next] usb: dwc3: gadget: remove redundant ret variable in dwc3_gadget_vbus_draw Thinh Nguyen

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=202211170953310238773@zte.com.cn \
    --to=guo.ziliang@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=thinh.nguyen@synopsys.com \
    /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