From patchwork Thu Mar 23 07:48:24 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: 73881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2776076wrt; Thu, 23 Mar 2023 00:58:35 -0700 (PDT) X-Google-Smtp-Source: AK7set8iKwHG03YgG5MMUzta7MtMfkIK7K70SDJ/99dTKCbBsvMlVqbsHboXMMXdKKAqKaqxg9KB X-Received: by 2002:a17:906:808:b0:92b:f0d9:15f3 with SMTP id e8-20020a170906080800b0092bf0d915f3mr4461988ejd.37.1679558315656; Thu, 23 Mar 2023 00:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679558315; cv=none; d=google.com; s=arc-20160816; b=j79oka0dleelv38IQm3tCWNBF9VwOVt0FHG6hM3MJ9cgo3pgumaOPkhpqLV37/aM1t Hk3jSI21hhZPGKvp0cVpJTVfZs+HqHtFcVzWkcWvYRj6aWc2+HJj5eS2ZxeWP6HSrpk1 dEXYngxldREmFXNVaH0IpMN7+zbLPLnC5B1A3l4ujCDiLFfhUQ4SGs8mB9NnmnTSkduZ 3m+IBU/w53/ySImtU8W07x60IyzlWN8gRJlfilNu5CrQQIa44UmY6NIHEEn9LKSu1ngn /XRBlC7jEk5TwwutKTJPoxFZbAk0lj1jXlx3xJUdDk5CNFe34Y3fMaaE9YnkBp3wvZCR Ehkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=7Y0Uf8zss9uC/wdCaQc4LQO9GtCm338DRUz8/s8W2z8=; b=bTsZMMQ40BZh+M+RmPDIoKlwZEJBR5U9stgR37xGEyuOQEONSrWFJ3Yj696Hfc3zvZ P6A5Os8ni7AvwWxDyyL6mF/7nuB7xoHteR/wBonZSqVXKqb8lQFMgf9npvtTCGAe7Cr9 nynmwwWGwao9PRpqw5k03+zXq/kMl0PVxNG+KlBxliDQjX+jassusqC0kTbxpv8oMHif 53uxNrhzyKJoyM1mqJB2779vn+WeG6yNEduMF1AfI08+w1cVBGwucWZ6hvk3f4GTGWli ildr8g8bJrawrfgtf+le0L80ln8IphkKc16JsnEllOoD3dRIffgvZzT+UqosYH043iF7 SB2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dx19-20020a170906a85300b0092533cf4684si16906833ejb.961.2023.03.23.00.58.12; Thu, 23 Mar 2023 00:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbjCWHss (ORCPT + 99 others); Thu, 23 Mar 2023 03:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230387AbjCWHsn (ORCPT ); Thu, 23 Mar 2023 03:48:43 -0400 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185906A58 for ; Thu, 23 Mar 2023 00:48:38 -0700 (PDT) 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 4PhyBr4WGgz501SV; Thu, 23 Mar 2023 15:48:36 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 32N7mM7A093948; Thu, 23 Mar 2023 15:48:22 +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 15:48:24 +0800 (CST) Date: Thu, 23 Mar 2023 15:48:24 +0800 (CST) X-Zmail-TransId: 2afa641c04487c5-8d9ae X-Mailer: Zmail v1.0 Message-ID: <202303231548246252332@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?utf-8?q?=5BPATCH=5D_phy=3A_rockchip-inno-usb2=3A_Use_dev=5Ferr=5F?= =?utf-8?q?probe=28=29?= X-MAIL: mse-fl2.zte.com.cn 32N7mM7A093948 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 641C0454.004/4PhyBr4WGgz501SV X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761144540761507834?= X-GMAIL-MSGID: =?utf-8?q?1761144540761507834?= From: Ye Xingchen Replace the open-code with dev_err_probe() to simplify the code. Signed-off-by: Ye Xingchen --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index a0bc10aa7961..19d2d32472f5 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -380,11 +380,9 @@ static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy) if (of_property_read_bool(node, "extcon")) { edev = extcon_get_edev_by_phandle(rphy->dev, 0); - if (IS_ERR(edev)) { - if (PTR_ERR(edev) != -EPROBE_DEFER) - dev_err(rphy->dev, "Invalid or missing extcon\n"); - return PTR_ERR(edev); - } + if (IS_ERR(edev)) + return dev_err_probe(rphy->dev, PTR_ERR(edev), + "Invalid or missing extcon\n"); } else { /* Initialize extcon device */ edev = devm_extcon_dev_allocate(rphy->dev,