From: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
To: Xu Wang <vulab@iscas.ac.cn>,
Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"p.zabel@pengutronix.de" <p.zabel@pengutronix.de>,
"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
"broonie@kernel.org" <broonie@kernel.org>,
Felipe Balbi <balbi@kernel.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc2: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
Date: Tue, 8 Dec 2020 07:29:32 +0000 [thread overview]
Message-ID: <2a1cdaa8-0582-6651-49e6-ee459e6a5f33@synopsys.com> (raw)
In-Reply-To: <20201204083644.2704-1-vulab@iscas.ac.cn>
On 12/4/2020 12:36, Xu Wang wrote:
> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.
>
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Reviewed-by: Artur Petrosyan <Arthur.Petrosyan@synopsys.com>
> ---
> drivers/usb/dwc2/platform.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
> index 5f18acac7406..ba2b491c7f82 100644
> --- a/drivers/usb/dwc2/platform.c
> +++ b/drivers/usb/dwc2/platform.c
> @@ -143,11 +143,9 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
> if (ret)
> return ret;
>
> - if (hsotg->clk) {
> - ret = clk_prepare_enable(hsotg->clk);
> - if (ret)
> - return ret;
> - }
> + ret = clk_prepare_enable(hsotg->clk);
> + if (ret)
> + return ret;
>
> if (hsotg->uphy) {
> ret = usb_phy_init(hsotg->uphy);
> @@ -195,8 +193,7 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
> if (ret)
> return ret;
>
> - if (hsotg->clk)
> - clk_disable_unprepare(hsotg->clk);
> + clk_disable_unprepare(hsotg->clk);
>
> return 0;
> }
>
next prev parent reply other threads:[~2020-12-08 7:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-04 8:36 Xu Wang
2020-12-08 7:29 ` Artur Petrosyan [this message]
2020-12-08 7:33 ` 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=2a1cdaa8-0582-6651-49e6-ee459e6a5f33@synopsys.com \
--to=arthur.petrosyan@synopsys.com \
--cc=Minas.Harutyunyan@synopsys.com \
--cc=balbi@kernel.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=vulab@iscas.ac.cn \
/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
all inboxes | Powered by JetHome®