From: Wang Qing <wangqing@vivo.com>
To: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Wang Qing <wangqing@vivo.com>
Subject: [PATCH] usb: Use IS_ERR_OR_NULL() instead of IS_ERR()
Date: Fri, 6 Nov 2020 11:31:18 +0800 [thread overview]
Message-ID: <1604633478-24729-1-git-send-email-wangqing@vivo.com> (raw)
__usb_find_phy may return NULL, so we should use IS_ERR_OR_NULL()
Signed-off-by: Wang Qing <wangqing@vivo.com>
---
drivers/usb/phy/phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/phy/phy.c b/drivers/usb/phy/phy.c
index de21967..60c5ea4 100755
--- a/drivers/usb/phy/phy.c
+++ b/drivers/usb/phy/phy.c
@@ -460,7 +460,7 @@ struct usb_phy *usb_get_phy(enum usb_phy_type type)
spin_lock_irqsave(&phy_lock, flags);
phy = __usb_find_phy(&phy_list, type);
- if (IS_ERR(phy) || !try_module_get(phy->dev->driver->owner)) {
+ if (IS_ERR_OR_NULL(phy) || !try_module_get(phy->dev->driver->owner)) {
pr_debug("PHY: unable to find transceiver of type %s\n",
usb_phy_type_string(type));
if (!IS_ERR(phy))
--
2.7.4
next reply other threads:[~2020-11-06 3:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 3:31 Wang Qing [this message]
2020-11-06 6:52 ` Greg Kroah-Hartman
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=1604633478-24729-1-git-send-email-wangqing@vivo.com \
--to=wangqing@vivo.com \
--cc=balbi@kernel.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
all inboxes | Powered by JetHome®