From patchwork Wed Aug 21 07:37:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13770961 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 2AB86C52D6F for ; Wed, 21 Aug 2024 07:39:05 +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-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RT+xNvS91oUZmgrFm0whaj9pHE06IUbxucr47hS+SAk=; b=IOAgBLUw++k9ddlQ7WeHZDLMmz y37zU/oP0nr2UIeLXqJQgJOR0CYQoC0do4a1mmXauksND5ISKcOtv7XB0oSgh4pFJpz83TVjHzQNU pqZt/PVF1zo8kjbp+Gm2j4Ru0KeYsVFhSGGzBSE3PPWULkfpoVu3nC8QR0BuSwcKQZxrZfk+Y8fBM rpbXXJMpBgR9BaesiEBujPoRWPoni4WNjVabeoIIkEV9iHn0UfeX25PQh6wJEpKzDqZbbOWLEaMPZ IwkyVtOpcJEnvRYIQNEd4cJcUyOlbB+FLa3XToDP1XcoQ1xtvA39gR5a8puQDxBpxVSQQLImYSKdI BeS4hgKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfve-00000007wXP-0eVr; Wed, 21 Aug 2024 07:38:50 +0000 Received: from mail.manjaro.org ([116.203.91.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfuw-00000007wQz-1pjy; Wed, 21 Aug 2024 07:38:08 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1724225882; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RT+xNvS91oUZmgrFm0whaj9pHE06IUbxucr47hS+SAk=; b=bp1P0FN5SUbljLV+qPoyYshQdGr/Ss6zbzGvldDpeAR8Jpt12GZE6QZBne6UW7v0kHgVC6 NbEGsn51h972eBdHe8U7An8hbzoba85u0W/jdAm9GFy8nZ2bHpr7H8trpBg1nlzjDdiUE3 psAMVGJ8kjOCiSXw4N9GjCD00aY8d7yx2u3Yob2/Alp1+tEHxeHZDtuQfAIMsSfgbD14KB LaZuMUy4bV5ZT8Y4XV3WJ2s18NrGGuzsbwUK0XKeZJ3aIl6UnvRQTiutL1l5xzsfMf6wQw Loqs8M+BagMZvzcUg3KAHSCemT0XWOj1qLTuTfGV67hktM9QlC5q9uVQgJUrZQ== To: linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: vkoul@kernel.org, kishon@kernel.org, heiko@sntech.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] phy: phy-rockchip-inno-usb2: Perform trivial code cleanups Date: Wed, 21 Aug 2024 09:37:53 +0200 Message-Id: <14167d6b025e18d2a06ee429feea6551ef6f9c44.1724225528.git.dsimic@manjaro.org> In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_003806_784824_1157DDFE X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Perform a few trivial code cleanups, e.g. to obey the reverse Christmas tree rule, to avoid use of "{ ... }" code blocks where they aren't really needed, or to avoid line wrapping by using the 100-column width better. No intended functional changes are introduced by these code cleanups. Signed-off-by: Dragan Simic Reviewed-by: Heiko Stuebner --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 4f71373ae6e1..113bfc717ff0 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -418,9 +418,9 @@ rockchip_usb2phy_clk480m_register(struct rockchip_usb2phy *rphy) static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy) { - int ret; struct device_node *node = rphy->dev->of_node; struct extcon_dev *edev; + int ret; if (of_property_read_bool(node, "extcon")) { edev = extcon_get_edev_by_phandle(rphy->dev, 0); @@ -445,7 +445,6 @@ static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy) } rphy->edev = edev; - return 0; } @@ -1327,21 +1326,19 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) struct rockchip_usb2phy *rphy; const struct rockchip_usb2phy_cfg *phy_cfgs; unsigned int reg; - int index, ret; + int index = 0, ret; rphy = devm_kzalloc(dev, sizeof(*rphy), GFP_KERNEL); if (!rphy) return -ENOMEM; if (!dev->parent || !dev->parent->of_node) { rphy->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf"); if (IS_ERR(rphy->grf)) { dev_err(dev, "failed to locate usbgrf\n"); return PTR_ERR(rphy->grf); } - } - - else { + } else { rphy->grf = syscon_node_to_regmap(dev->parent->of_node); if (IS_ERR(rphy->grf)) return PTR_ERR(rphy->grf); @@ -1358,16 +1355,14 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) } if (of_property_read_u32_index(np, "reg", 0, ®)) { - dev_err(dev, "the reg property is not assigned in %pOFn node\n", - np); + dev_err(dev, "the reg property is not assigned in %pOFn node\n", np); return -EINVAL; } /* support address_cells=2 */ if (of_property_count_u32_elems(np, "reg") > 2 && reg == 0) { if (of_property_read_u32_index(np, "reg", 1, ®)) { - dev_err(dev, "the reg property is not assigned in %pOFn node\n", - np); + dev_err(dev, "the reg property is not assigned in %pOFn node\n", np); return -EINVAL; } } @@ -1386,8 +1381,7 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) if (ret) return ret; - /* find out a proper config which can be matched with dt. */ - index = 0; + /* find a proper config that can be matched with the DT */ do { if (phy_cfgs[index].reg == reg) { rphy->phy_cfg = &phy_cfgs[index]; @@ -1407,10 +1401,9 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) return PTR_ERR(rphy->phy_reset); rphy->clk = devm_clk_get_optional_enabled(dev, "phyclk"); - if (IS_ERR(rphy->clk)) { + if (IS_ERR(rphy->clk)) return dev_err_probe(&pdev->dev, PTR_ERR(rphy->clk), "failed to get phyclk\n"); - } ret = rockchip_usb2phy_clk480m_register(rphy); if (ret) { @@ -1446,13 +1439,11 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) /* initialize otg/host port separately */ if (of_node_name_eq(child_np, "host-port")) { - ret = rockchip_usb2phy_host_port_init(rphy, rport, - child_np); + ret = rockchip_usb2phy_host_port_init(rphy, rport, child_np); if (ret) goto put_child; } else { - ret = rockchip_usb2phy_otg_port_init(rphy, rport, - child_np); + ret = rockchip_usb2phy_otg_port_init(rphy, rport, child_np); if (ret) goto put_child; } From patchwork Wed Aug 21 07:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13770969 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 204B7C52D6F for ; Wed, 21 Aug 2024 07:40:23 +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-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=if9diTT6JYwENr+1sloMXQnDz1UcYLmsRE38kgYhmSI=; b=is1YVIWRyZXv5JTcp4VuE4hp4v +vHCx2qlsLltZ9SnEUAtJ8iqCa+ncajzlkDF7EsVHSc3c3+GtyjI1jPQtbLKCrIQX9YB/F2bkqRoJ z6VTefCU+kkRaYDilipX6eBvGETceiwWu2h1m6gLDGeuMDS1K/pYcvF2xkt9t1LYNxoh63ojxxUNS M+XFlgXq1Q8ClFMiDGgawFXxAPV67AuH3N3wbyJJR0o7O3644oNX7FkOBi6Ltl+XC2Wzw/Lzrz5Mj 1DsL7+esbqRJr7pNXmlUIWXAevYJKlKAAo6wMnXSfXlmZ0rjEXtiZ8CVHhCAYtOStXz6lJdaQPurZ iQH2wcAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfwz-00000007woF-1QrG; Wed, 21 Aug 2024 07:40:13 +0000 Received: from mail.manjaro.org ([2a01:4f8:c0c:51f3::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfuw-00000007wRC-3BTP; Wed, 21 Aug 2024 07:38:09 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1724225883; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=if9diTT6JYwENr+1sloMXQnDz1UcYLmsRE38kgYhmSI=; b=MTU/bCDaX3eIb5UE16lyGI6Md+9RwHmHaLnnA2RCQ5wEnQJOBuF6SUe+Cx/ScOenksCtGj SAeOJhftHM72vvoad1dr9PqALtaIBR26OFC/hO8M31c01usSEbumaYF4mag8XY2FRUmpJC 8hcuKRB4zp+hfjVsrwwgz+8kU7tFl4X3mFlmpT9/Y82e9oAznQeLkvywrfCJICqFEzoV0M sl/zdDOw+vcGqWIHjwUZs2cT5nlIFdjg3lM+ReTexELq0clsI5/GJ/HNAZ2jkiCs5zb+fT 6WJAARLzuo5dkTYVtZxCWizOPw1y7W/VOiP039Ou334RBK8TppvXPKxR+PI3xA== To: linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: vkoul@kernel.org, kishon@kernel.org, heiko@sntech.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] phy: phy-rockchip-inno-usb2: Handle failed extcon allocation better Date: Wed, 21 Aug 2024 09:37:54 +0200 Message-Id: <96200baf794a0c451f3bbc3f5530b8cf0e359dfc.1724225528.git.dsimic@manjaro.org> In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_003806_963321_1597167D X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Return the actual error code upon failure to allocate extcon device, instead of hardcoding -ENOMEM. Use dev_err_probe() to also log appropriate messages, which is fine because the containing function is used in the probe path. Helped-by: Heiko Stubner Signed-off-by: Dragan Simic Reviewed-by: Heiko Stuebner --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 113bfc717ff0..05af46dda11d 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -435,7 +435,8 @@ static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy) rockchip_usb2phy_extcon_cable); if (IS_ERR(edev)) - return -ENOMEM; + return dev_err_probe(rphy->dev, PTR_ERR(edev), + "failed to allocate extcon device\n"); ret = devm_extcon_dev_register(rphy->dev, edev); if (ret) { From patchwork Wed Aug 21 07:37:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13770970 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 3C4F6C52D7C for ; Wed, 21 Aug 2024 07:41:11 +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-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7mpSgzy1mYsfmRZERxM1qKQwFf2Bvpti+0UrXxT9LS0=; b=OrzrijwHbiUEPHoh7Cf5jk4hRL rXYNqMzeJWiEQKr5aPsQ1PThJ50deBAgksx4yK0ZoRQNqyzsZLmhVxPD1tlVvSz3PoPc9HhPiPUFN nbO9utTTSJjlh6Eb7LZNEhjEfLCrcnZ5JeRcVMCmE6Vjb+6rHZPdoV/NomX0W2zza5SYegiD9vETT pCn5Ijo2eSgLOLHt2VwNo6YuSEyjRCqVRxKniy75/shL/PeU8BWy5zaHr2cx3jAg7pdr7rVZNkNdU jbac9XY8MhV2w7T5e8fPFxDApFI5Wy/4KstPPippUHv8Seyx9sUsiEnM+YesENHp8abxUpGhANidr VbG8oV0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfxf-00000007wwG-1t2y; Wed, 21 Aug 2024 07:40:55 +0000 Received: from mail.manjaro.org ([116.203.91.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfux-00000007wRJ-07Zj; Wed, 21 Aug 2024 07:38:10 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1724225884; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7mpSgzy1mYsfmRZERxM1qKQwFf2Bvpti+0UrXxT9LS0=; b=VAhqzafl1g0io65W7HyURf3pSL/CuyQtt3tQtsLmL6RP/7/Y5D791BM11qXYjdTOzK1Uxd rUlZZtpStM7cbXzID5nq2aaFkEOusbAipxhnIUIJSvCs68zSJ8dSNkerAHOXN/A3t6uK1r nxx2Abak3LxXCzttOgeF1wkzldIDOQl+uh8B3uEWv66dsOeXBWQQyqLv1AV3AGP7bdbKen BZsZCj/L/ai2OosxqRKfLcuNUskNohqchZeEJbHg7AVSweKIJfNQp3jWdM/95k0IDOd5OR KSjZCjdexqBVPeZphtsQ9KPqX2t1Ki72Crfle9BHveqVOOsraqle0SOMPgwiug== To: linux-rockchip@lists.infradead.org, linux-phy@lists.infradead.org Cc: vkoul@kernel.org, kishon@kernel.org, heiko@sntech.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] phy: phy-rockchip-inno-usb2: Improve error handling while probing Date: Wed, 21 Aug 2024 09:37:55 +0200 Message-Id: <866445027a4f41165c872f494b04c218b6e67b09.1724225528.git.dsimic@manjaro.org> In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_003807_371951_A32D1965 X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Improve error handling in the probe path by using function dev_err_probe() where appropriate, and by no longer using it rather pointlessly in one place that actually produces a single, hardcoded error code. Signed-off-by: Dragan Simic --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 05af46dda11d..30b6134365ec 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -424,25 +424,22 @@ 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, rockchip_usb2phy_extcon_cable); if (IS_ERR(edev)) return dev_err_probe(rphy->dev, PTR_ERR(edev), "failed to allocate extcon device\n"); ret = devm_extcon_dev_register(rphy->dev, edev); - if (ret) { - dev_err(rphy->dev, "failed to register extcon device\n"); - return ret; - } + if (ret) + return dev_err_probe(rphy->dev, ret, + "failed to register extcon device\n"); } rphy->edev = edev; @@ -1375,8 +1372,10 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) rphy->irq = platform_get_irq_optional(pdev, 0); platform_set_drvdata(pdev, rphy); - if (!phy_cfgs) - return dev_err_probe(dev, -EINVAL, "phy configs are not assigned!\n"); + if (!phy_cfgs) { + dev_err(dev, "phy configs are not assigned\n"); + return -EINVAL; + } ret = rockchip_usb2phy_extcon_register(rphy); if (ret) @@ -1407,10 +1406,8 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) "failed to get phyclk\n"); ret = rockchip_usb2phy_clk480m_register(rphy); - if (ret) { - dev_err(dev, "failed to register 480m output clock\n"); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "failed to register 480m output clock\n"); if (rphy->phy_cfg->phy_tuning) { ret = rphy->phy_cfg->phy_tuning(rphy); @@ -1430,8 +1427,7 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) phy = devm_phy_create(dev, child_np, &rockchip_usb2phy_ops); if (IS_ERR(phy)) { - dev_err_probe(dev, PTR_ERR(phy), "failed to create phy\n"); - ret = PTR_ERR(phy); + ret = dev_err_probe(dev, PTR_ERR(phy), "failed to create phy\n"); goto put_child; } @@ -1466,8 +1462,7 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) "rockchip_usb2phy", rphy); if (ret) { - dev_err(rphy->dev, - "failed to request usb2phy irq handle\n"); + dev_err_probe(rphy->dev, ret, "failed to request usb2phy irq handle\n"); goto put_child; } }