Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp563235pxb; Wed, 15 Sep 2021 08:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8cqXmrQ283/rPXoOyMWZgvaoQSLVnMptadNGep2c8+2FXcqpbUkC02rpfBz8pS2gxlLom X-Received: by 2002:a92:b702:: with SMTP id k2mr424053ili.150.1631718942869; Wed, 15 Sep 2021 08:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631718942; cv=none; d=google.com; s=arc-20160816; b=sMjudyVEP7ufXKZB1KiPWLVV6st5m/OTUXdrWhukvg3xc8vNRQTuLXqOb4SNTb1XNd FQqNVa6wPyq0awSZIXVk5dguaXaWetPYbS4KaFs90C5OPsGs6DIGWeGVi1wlLACFlKQM K5C/Uy5ury5pUPTXs6kYVdAJWwSB12aTKqpFCEn5HTnCUrVehYUEiqo3XT3KN7kNZbTf tzG98wT4v4O4/l03McSmOrqyHnroHLN0F4OzGb2CxnehF56ihXePpWgCt8X4OV9wlCJ4 hWpy+AyZb/bzR8KBaDwCj2D5Sv8D8NI1Fd92ECYTlLOYSbC8mDydNlRsLScw/P3pKzmA Qiug== 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=MFKtDERVOyzkiSQuRNzA8FA/mmLzYVe9Cu9+l7+5ONo=; b=mefySEMegfDgvMRpSGOKMb/H8SG2dLsFCr8O80ZF2hTIvW4k5PSoL88jIFqMjUEiD5 TpkWw0YyMYzTIt6DNjhVPTIaBeXv2HAuigTB0FSXIxQ82EIA7QDxbWeUy+c93DEzmtl3 q2Fx6lZHIAvicsiJTXuUzruXB30YEdL3zVAE5xw3y4f3NJxR/rAjH7lfzyLl6VjcuLzE XzEl6Ie2bGy1yHGgR6IBnKeeErhj7/xgoGGRYJCNicr6UrsQjC3avE+mxguSopEVG08Y 75KKiGKuHt4TOW3xakFd2d3VF2y27E6iUoSp7543Yai5oXG6XeP0MpYXeyV2yG2ZM0Ln W6aw== 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 x4si177741ilj.121.2021.09.15.08.15.21; Wed, 15 Sep 2021 08:15:42 -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 S238130AbhIOPPC (ORCPT + 99 others); Wed, 15 Sep 2021 11:15:02 -0400 Received: from mx22.baidu.com ([220.181.50.185]:40644 "EHLO baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234169AbhIOPOt (ORCPT ); Wed, 15 Sep 2021 11:14:49 -0400 Received: from BJHW-Mail-Ex08.internal.baidu.com (unknown [10.127.64.18]) by Forcepoint Email with ESMTPS id 7ED762B3A921289AE33D; Wed, 15 Sep 2021 22:58:02 +0800 (CST) Received: from BJHW-MAIL-EX27.internal.baidu.com (10.127.64.42) by BJHW-Mail-Ex08.internal.baidu.com (10.127.64.18) 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:02 +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:01 +0800 From: Cai Huoqing To: CC: Chris Snook , "David S. Miller" , Jakub Kicinski , , Subject: [PATCH] net: atl1e: Make use of the helper function dev_err_probe() Date: Wed, 15 Sep 2021 22:57:56 +0800 Message-ID: <20210915145757.7304-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) X-Baidu-BdMsfe-DateCheck: 1_BJHW-Mail-Ex08_2021-09-15 22:58:02:535 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/atheros/atl1e/atl1e_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c index 753973ac922e..2e22483a9040 100644 --- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c +++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c @@ -2297,10 +2297,8 @@ static int atl1e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) int err = 0; 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"); /* * The atl1e chip can DMA to 64-bit addresses, but it uses a single -- 2.25.1