From: Huazhong Tan <tanhuazhong@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
<linuxarm@huawei.com>, <saeedm@mellanox.com>,
Guangbin Huang <huangguangbin@huawei.com>,
"Huazhong Tan" <tanhuazhong@huawei.com>
Subject: [PATCH V3 net-next 02/10] net: hns3: add a check for get_reset_level
Date: Sat, 27 Jul 2019 13:46:04 +0800 [thread overview]
Message-ID: <1564206372-42467-3-git-send-email-tanhuazhong@huawei.com> (raw)
In-Reply-To: <1564206372-42467-1-git-send-email-tanhuazhong@huawei.com>
From: Guangbin Huang <huangguangbin@huawei.com>
For some cases, ops->get_reset_level may not be implemented, so we
should check whether it is NULL before calling get_reset_level.
Signed-off-by: Guangbin Huang <huangguangbin@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 08af782..4d58c53 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -1963,7 +1963,7 @@ static pci_ers_result_t hns3_slot_reset(struct pci_dev *pdev)
ops = ae_dev->ops;
/* request the reset */
- if (ops->reset_event) {
+ if (ops->reset_event && ops->get_reset_level) {
if (ae_dev->hw_err_reset_req) {
reset_type = ops->get_reset_level(ae_dev,
&ae_dev->hw_err_reset_req);
--
2.7.4
next prev parent reply other threads:[~2019-07-27 5:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-27 5:46 [PATCH V3 net-next 00/10] net: hns3: some code optimizations & bugfixes & features Huazhong Tan
2019-07-27 5:46 ` [PATCH V3 net-next 01/10] net: hns3: add reset checking before set channels Huazhong Tan
2019-07-27 5:46 ` Huazhong Tan [this message]
2019-07-27 5:46 ` [PATCH V3 net-next 03/10] net: hns3: remove upgrade reset level when reset fail Huazhong Tan
2019-07-27 5:46 ` [PATCH V3 net-next 04/10] net: hns3: change GFP flag during lock period Huazhong Tan
2019-07-27 5:46 ` [PATCH V3 net-next 05/10] net: hns3: modify firmware version display format Huazhong Tan
2019-07-27 5:46 ` [PATCH V3 net-next 06/10] net: hns3: add debug messages to identify eth down cause Huazhong Tan
2019-07-28 2:03 ` David Miller
2019-07-29 1:21 ` tanhuazhong
2019-07-27 5:46 ` [PATCH V3 net-next 07/10] net: hns3: make hclge_service use delayed workqueue Huazhong Tan
2019-07-27 5:46 ` [PATCH V3 net-next 08/10] net: hns3: add interrupt affinity support for misc interrupt Huazhong Tan
2019-07-27 5:46 ` [PATCH V3 net-next 09/10] net: hns3: Add support for using order 1 pages with a 4K buffer Huazhong Tan
2019-07-27 5:46 ` [PATCH V3 net-next 10/10] net: hns3: use dev_info() instead of pr_info() Huazhong Tan
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=1564206372-42467-3-git-send-email-tanhuazhong@huawei.com \
--to=tanhuazhong@huawei.com \
--cc=davem@davemloft.net \
--cc=huangguangbin@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@mellanox.com \
--cc=salil.mehta@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