From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Vinod Koul <vkoul@kernel.org>, Rob Herring <robh+dt@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Alex Dewar <alex.dewar90@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Yu Chen <chenyu56@huawei.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v4 3/5] staging: hikey9xx: phy-hi3670-usb3: hi3670_is_abbclk_seleted() returns bool
Date: Tue, 19 Jan 2021 11:44:41 +0100 [thread overview]
Message-ID: <a579004cfa0cb3cca55c2124a8574a7aeb4eacc3.1611052729.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1611052729.git.mchehab+huawei@kernel.org>
There are a few issues on this function:
1. Instead of using 1/0 for true/false, change the type to boolean;
2. there's a typo there:
seleted -> selected
3. It's logic is reversed.
Address them.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
drivers/staging/hikey9xx/phy-hi3670-usb3.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/hikey9xx/phy-hi3670-usb3.c b/drivers/staging/hikey9xx/phy-hi3670-usb3.c
index cffe6c58dfd7..8918f3665f8e 100644
--- a/drivers/staging/hikey9xx/phy-hi3670-usb3.c
+++ b/drivers/staging/hikey9xx/phy-hi3670-usb3.c
@@ -326,24 +326,24 @@ static int hi3670_phy_set_params(struct hi3670_priv *priv)
return ret;
}
-static int hi3670_is_abbclk_seleted(struct hi3670_priv *priv)
+static bool hi3670_is_abbclk_selected(struct hi3670_priv *priv)
{
u32 reg;
if (!priv->sctrl) {
dev_err(priv->dev, "priv->sctrl is null!\n");
- return 1;
+ return false;
}
if (regmap_read(priv->sctrl, SCTRL_SCDEEPSLEEPED, ®)) {
dev_err(priv->dev, "SCTRL_SCDEEPSLEEPED read failed!\n");
- return 1;
+ return false;
}
if ((reg & USB_CLK_SELECTED) == 0)
- return 1;
+ return false;
- return 0;
+ return true;
}
static int hi3670_config_phy_clock(struct hi3670_priv *priv)
@@ -351,7 +351,7 @@ static int hi3670_config_phy_clock(struct hi3670_priv *priv)
u32 val, mask;
int ret;
- if (hi3670_is_abbclk_seleted(priv)) {
+ if (!hi3670_is_abbclk_selected(priv)) {
/* usb refclk iso disable */
ret = regmap_write(priv->peri_crg, PERI_CRG_ISODIS,
USB_REFCLK_ISO_EN);
@@ -568,7 +568,7 @@ static int hi3670_phy_exit(struct phy *phy)
if (ret)
goto out;
- if (hi3670_is_abbclk_seleted(priv)) {
+ if (!hi3670_is_abbclk_selected(priv)) {
/* disable usb_tcxo_en */
ret = regmap_write(priv->pctrl, PCTRL_PERI_CTRL3,
USB_TCXO_EN << PCTRL_PERI_CTRL3_MSK_START);
--
2.29.2
next prev parent reply other threads:[~2021-01-19 10:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 10:44 [PATCH v4 0/5] Promote Hikey 970 USB phy out of staging Mauro Carvalho Chehab
2021-01-19 10:44 ` [PATCH v4 1/5] staging: hikey9xx: phy-hi3670-usb3: use bitfield macros Mauro Carvalho Chehab
2021-01-19 10:44 ` [PATCH v4 2/5] staging: hikey9xx: phy-hi3670-usb3: adjust retry logic Mauro Carvalho Chehab
2021-01-19 10:44 ` Mauro Carvalho Chehab [this message]
2021-01-19 10:44 ` [PATCH v4 4/5] staging: hikey9xx: phy-hi3670-usb3.yaml: add a blank line Mauro Carvalho Chehab
2021-01-19 10:44 ` [PATCH v4 5/5] phy: phy-hi3670-usb3: move driver from staging into phy Mauro Carvalho Chehab
2021-02-04 7:48 ` Vinod Koul
2021-02-05 22:13 ` Rob Herring
2021-01-26 17:49 ` [PATCH v4 0/5] Promote Hikey 970 USB phy out of staging Greg Kroah-Hartman
2021-02-04 7:49 ` Vinod Koul
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=a579004cfa0cb3cca55c2124a8574a7aeb4eacc3.1611052729.git.mchehab+huawei@kernel.org \
--to=mchehab+huawei@kernel.org \
--cc=alex.dewar90@gmail.com \
--cc=chenyu56@huawei.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=vkoul@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
all inboxes | Powered by JetHome®