Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7132291imm; Wed, 27 Jun 2018 21:11:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLm96+XtfQGyhR3Q5hADb0ttLe5sYnKRCOrtXlT+hIwaRta9dHI2UNSSLNxkBzJ8swU9NZe X-Received: by 2002:a17:902:3281:: with SMTP id z1-v6mr8924831plb.226.1530159111025; Wed, 27 Jun 2018 21:11:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530159110; cv=none; d=google.com; s=arc-20160816; b=OXHwvqeZIt957onMVtDJmTeaL3fo7Yp4FIerialedNZJZlqIiDabux8WtELVIMDq23 5qr+Gb1KFetsjcT7B7JK2gp7lzWqlJdA1viO/NAjqL914I4rg+pA97xomjh7cn71jKhx T11y34Sh5RfEmNdsA3aNN/qFYThdZzdnL+7mDaSGSWJI0fbQ3LCooANGOYiehFGbPgEu OiG+3LLrrCQvaNzJwc3M9CmYQYLp7OzBqCCo3c3k4LTf5K8qHglCWiZCWzGsW73woGPl T4C/cmkL1g4ZcE213nAHCkxdXU6UbSjlCQQmopmavsEzRZm0x02IIG30tUdZ1oG7NjUb yc1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=pY6W79t1xu/R5TycvzXY5wdMPSQcvPsbr7U0XENjdIo=; b=QexDWMmWwlBWsYXGJPgixk089U6tBlO71U8Hv2mRAM3AmuffHP/4+n1FtvVxvdndAd wr8gmsJcYNL7PgfkEHKr0KIMSjUtY2/l0Jyu5q0lg9uwkGlowfK7gvyHV2GrHVTU3fSz 36Fv/G4rcUW41pGesevSN+h/ZN0BgOpQsst5sMMlNNmSy0XGHngbPawUDZ0hZsFOY88s jbr1vcKg/RLHC0adujo0LlY7/1pxjNFWRXnO2/rhUsHOVvxZKjlqh7LOjmv0bVbxK88G FSqK6oF2CgaFMKi+KV4rD4vvqtSw/SL5sQhsM+neYvy+Dd3TpDubz/NWB4K6a7EPzQfR vdkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3-v6si4821992pgv.573.2018.06.27.21.11.36; Wed, 27 Jun 2018 21:11:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932097AbeF1DnM (ORCPT + 99 others); Wed, 27 Jun 2018 23:43:12 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:8739 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753060AbeF1DlM (ORCPT ); Wed, 27 Jun 2018 23:41:12 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 381AD8D5767BA; Thu, 28 Jun 2018 11:40:58 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.382.0; Thu, 28 Jun 2018 11:40:54 +0800 From: Peng Li To: CC: , , , , , Subject: [PATCH net-next 08/11] net: hns3: print the ret value in error information Date: Thu, 28 Jun 2018 12:12:26 +0800 Message-ID: <1530159149-122284-9-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1530159149-122284-1-git-send-email-lipeng321@huawei.com> References: <1530159149-122284-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Print the ret value in error information can help find the reason. Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hnae3.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c index 3e5c83f..1a02620 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c @@ -94,7 +94,7 @@ static int hnae3_match_n_instantiate(struct hnae3_client *client, ret = ae_dev->ops->init_client_instance(client, ae_dev); if (ret) { dev_err(&ae_dev->pdev->dev, - "fail to instantiate client\n"); + "fail to instantiate client, ret = %d\n", ret); return ret; } @@ -134,7 +134,8 @@ int hnae3_register_client(struct hnae3_client *client) ret = hnae3_match_n_instantiate(client, ae_dev, true); if (ret) dev_err(&ae_dev->pdev->dev, - "match and instantiation failed for port\n"); + "match and instantiation failed for port, ret = %d\n", + ret); } exit: @@ -184,7 +185,8 @@ void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo) ae_dev->ops = ae_algo->ops; ret = ae_algo->ops->init_ae_dev(ae_dev); if (ret) { - dev_err(&ae_dev->pdev->dev, "init ae_dev error.\n"); + dev_err(&ae_dev->pdev->dev, + "init ae_dev error, ret = %d\n", ret); continue; } @@ -197,7 +199,8 @@ void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo) ret = hnae3_match_n_instantiate(client, ae_dev, true); if (ret) dev_err(&ae_dev->pdev->dev, - "match and instantiation failed\n"); + "match and instantiation failed, ret = %d\n", + ret); } } @@ -270,7 +273,8 @@ void hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev) /* ae_dev init should set flag */ ret = ae_dev->ops->init_ae_dev(ae_dev); if (ret) { - dev_err(&ae_dev->pdev->dev, "init ae_dev error\n"); + dev_err(&ae_dev->pdev->dev, + "init ae_dev error, ret = %d\n", ret); goto out_err; } @@ -285,7 +289,8 @@ void hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev) ret = hnae3_match_n_instantiate(client, ae_dev, true); if (ret) dev_err(&ae_dev->pdev->dev, - "match and instantiation failed\n"); + "match and instantiation failed, ret = %d\n", + ret); } out_err: -- 2.9.3