From: thunder.leizhen@huaweicloud.com
To: Yisen Zhuang <yisen.zhuang@huawei.com>,
Salil Mehta <salil.mehta@huawei.com>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Cc: Zhen Lei <thunder.leizhen@huawei.com>
Subject: [PATCH] net: hns: Remove a redundant check in hns_mdio_probe()
Date: Fri, 4 Aug 2023 17:27:53 +0800 [thread overview]
Message-ID: <20230804092753.1207-1-thunder.leizhen@huaweicloud.com> (raw)
From: Zhen Lei <thunder.leizhen@huawei.com>
Traverse all devices when a new driver is installed, or, traverse all
drivers when a new device is added. In any case, the input argument
'pdev' of drv->probe() cannot be NULL.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/net/ethernet/hisilicon/hns_mdio.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns_mdio.c b/drivers/net/ethernet/hisilicon/hns_mdio.c
index 9232caaf0bdc1bb..37ff12ff0062442 100644
--- a/drivers/net/ethernet/hisilicon/hns_mdio.c
+++ b/drivers/net/ethernet/hisilicon/hns_mdio.c
@@ -498,11 +498,6 @@ static int hns_mdio_probe(struct platform_device *pdev)
struct mii_bus *new_bus;
int ret;
- if (!pdev) {
- dev_err(NULL, "pdev is NULL!\r\n");
- return -ENODEV;
- }
-
mdio_dev = devm_kzalloc(&pdev->dev, sizeof(*mdio_dev), GFP_KERNEL);
if (!mdio_dev)
return -ENOMEM;
--
2.34.1
next reply other threads:[~2023-08-04 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-04 9:27 thunder.leizhen [this message]
2023-08-05 11:29 ` [PATCH] net: hns: Remove a redundant check in hns_mdio_probe() Simon Horman
2023-08-06 10:08 ` Leizhen (ThunderTown)
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=20230804092753.1207-1-thunder.leizhen@huaweicloud.com \
--to=thunder.leizhen@huaweicloud.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=salil.mehta@huawei.com \
--cc=thunder.leizhen@huawei.com \
--cc=yisen.zhuang@huawei.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;
as well as URLs for NNTP newsgroup(s).