From patchwork Thu Mar 23 03:45:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 13184876 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26271C6FD1C for ; Thu, 23 Mar 2023 03:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Subject:Cc:To: From:Mime-Version:Message-ID:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=SIY1UEfn+k3C/MZIb/OwTBtQjYHxZO8w0H9H0asLGbo=; b=GjGMgHm48+mT/oWriYbtku+9RF bwubeq8Ra0PnGjbAu0oHOgnnBv4ulhTE3doy0sLN8YmBr33eXNYFmJuXoBn7+F7HD4O+0ah9bx12i 8sd1cjU0p9CrskSbP6ZwDjLWGfdKS+tGut1klyr+wENpjeEv8rDzsaVwnszg577YtwkHrw9VSr63H QIRuPiN10mqvGFojdcylgRORlDM2Wd5TZcbTzcKP0YfXthPxnxXglIDekxkSo0XWFff7bnzz3KLq7 QUy5myC7Ajb2v4Lo6h2d2p3lmeTM5uMh0igjgLxboY6P+MoYFI7maMNMjwYln3kkc7frpEgoRpiwj oX1KxhLA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pfBtN-000g5b-00; Thu, 23 Mar 2023 03:45:33 +0000 Received: from mxct.zte.com.cn ([183.62.165.209]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pfBtH-000g4T-2B; Thu, 23 Mar 2023 03:45:29 +0000 Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4Phrp91qMyz501SW; Thu, 23 Mar 2023 11:45:21 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 32N3jAUI058150; Thu, 23 Mar 2023 11:45:11 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Thu, 23 Mar 2023 11:45:12 +0800 (CST) Date: Thu, 23 Mar 2023 11:45:12 +0800 (CST) X-Zmail-TransId: 2afa641bcb48fffffffff41-66350 X-Mailer: Zmail v1.0 Message-ID: <202303231145121987818@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , , , , Subject: =?utf-8?q?=5BPATCH=5D_PCI=3A_mt7621=3A_Use_dev=5Ferr=5Fprobe=28=29?= X-MAIL: mse-fl2.zte.com.cn 32N3jAUI058150 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 641BCB51.001/4Phrp91qMyz501SW X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230322_204527_872096_86BBDC58 X-CRM114-Status: UNSURE ( 9.06 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Ye Xingchen Replace the open-code with dev_err_probe() to simplify the code. Signed-off-by: Ye Xingchen --- drivers/pci/controller/pcie-mt7621.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/pcie-mt7621.c b/drivers/pci/controller/pcie-mt7621.c index 63a5f4463a9f..964de0e8c6a0 100644 --- a/drivers/pci/controller/pcie-mt7621.c +++ b/drivers/pci/controller/pcie-mt7621.c @@ -220,10 +220,9 @@ static int mt7621_pcie_parse_port(struct mt7621_pcie *pcie, } port->pcie_rst = of_reset_control_get_exclusive(node, NULL); - if (PTR_ERR(port->pcie_rst) == -EPROBE_DEFER) { - dev_err(dev, "failed to get pcie%d reset control\n", slot); - return PTR_ERR(port->pcie_rst); - } + + return dev_err_probe(dev, PTR_ERR(port->pcie_rst), + "failed to get pcie%d reset control\n", slot); snprintf(name, sizeof(name), "pcie-phy%d", slot); port->phy = devm_of_phy_get(dev, node, name);