Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp564754pxb; Wed, 15 Sep 2021 08:17:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZu5yebCm8Qouoo4EZhbfZa7yTG4/RVZ8lTrb/Zl871XbFuertJFHaAOwKP3KL9tQXy0bi X-Received: by 2002:a02:2341:: with SMTP id u62mr471134jau.6.1631719047105; Wed, 15 Sep 2021 08:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631719047; cv=none; d=google.com; s=arc-20160816; b=wFQ9tcYcyHnczAQp87I/nHRkDT7mVlItw6ZP3posVLAEE5F/m82ti89kFZXxjr/i35 izDEPiwiY7Dk16q/RWUJp4gi99kR1KXNebo/TGuUEHaRrWfZpYqVOWSd40pgcZiZ5fOZ aaqlc7lfBRJvWX+DhFqwlIQZ0kwDxsfeFikcS5A3AGaZopsWE8BgbaLGKq7CFsg7KFB6 m5Fzz9erzVF1rk/2aiIavUXdBCOeqCHwWNaXQ72nnyXDm7NW74y5dwv4g0G/hMI8D9oK 5JKKXvPFHEq4O9WlpWcDLZsHLSvE478dywzzPE2qHTAYFHvWzOIlnq0KmFvJo47hqgVn L3Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=ylt4ak16qj7lUYdU7HAu8/GDtclw1zbIZ37Epw3dL0w=; b=q03oY+HCRRaeJ7it+pr1O9yPgjmSO4Lfc2eNwJUipB2XAXaPOzn8SIcvmLJ/C01PRH +rU23sKH5Z40w3GX/aM16O4hLm0X9key+VZDYM377zrNdXXPuaYmo68BOnHEhnCtjKg4 7bR8jpFYDrnikunXitQbtXkMC+7Vb/6cXk16pXaQun8fgPw5RyGGGiQ49Y3aAy2oGJO2 YHOmo1ssd3yzgEejiTLVn0BOaWtpGxr/LOo6WqnYMzBpGkiZ3NY2WxutaOdZE5YBuaK+ dZTlagp9oHT1WQYj7vd2SsIH6+vcPjhs3RTsLllPlVxYhJcqKTeB7SY0BGVvTulyVOMg N3WQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y28si163636iot.48.2021.09.15.08.17.12; Wed, 15 Sep 2021 08:17:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238179AbhIOPPx (ORCPT + 99 others); Wed, 15 Sep 2021 11:15:53 -0400 Received: from mx24.baidu.com ([111.206.215.185]:41276 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234169AbhIOPPu (ORCPT ); Wed, 15 Sep 2021 11:15:50 -0400 Received: from BJHW-Mail-Ex01.internal.baidu.com (unknown [10.127.64.11]) by Forcepoint Email with ESMTPS id DD5FE650D6EAAB5C8F55; Wed, 15 Sep 2021 22:58:17 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex01.internal.baidu.com (10.127.64.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 15 Sep 2021 22:58:17 +0800 Received: from LAPTOP-UKSR4ENP.internal.baidu.com (172.31.63.8) by BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 15 Sep 2021 22:58:17 +0800 From: Cai Huoqing To: CC: Raju Rangoju , "David S. Miller" , Jakub Kicinski , , Subject: [PATCH] net: chelsio: cxgb4vf: Make use of the helper function dev_err_probe() Date: Wed, 15 Sep 2021 22:58:11 +0800 Message-ID: <20210915145812.7410-1-caihuoqing@baidu.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.31.63.8] X-ClientProxiedBy: BJHW-Mail-Ex09.internal.baidu.com (10.127.64.32) To BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, and simplify the code. Signed-off-by: Cai Huoqing --- drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index 49b76fd47daa..4920a80a0460 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c @@ -2902,10 +2902,8 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, * Initialize generic PCI device state. */ err = pci_enable_device(pdev); - if (err) { - dev_err(&pdev->dev, "cannot enable PCI device\n"); - return err; - } + if (err) + return dev_err_probe(&pdev->dev, err, "cannot enable PCI device\n"); /* * Reserve PCI resources for the device. If we can't get them some -- 2.25.1