Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B0C63101B9 for ; Wed, 21 Jan 2026 01:49:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768960154; cv=none; b=KscwNJsjagfXL7kmk1wB8ZwlGwTZk0HSHTC2NHCgXy1IjSuWfyuaVuvlFm+KGUJqJWEl+P+6Gl2gaoFi6qyj0tHNeKNSBqqRN7r5I7UWZ/VvpbVbdAmi84pkl3mUu8u+QuGHwW1ny67lcd9MlpdcJ9aPZaE/svBho4zstWubEVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768960154; c=relaxed/simple; bh=oKGgkeOqoUdvc+SeEA+WSkGW3Y47q2k3FiRPuXw/5dE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dxrxnsc3gv888OCGjwejKymVMeOL4WjZ7hpxAaJRT5RvTJwcwoUyhtHtpS3afjXbiG2+25mYjJFr4JXfNvdhREAO4C80LORIbjQb247KeRyfc8eZuC0oPZkrmjRPnbygBWMi68VrtMc93hkubyqoe161EVT+gL8xkpqF1Gb1HLw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mlOghALq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mlOghALq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3CD6C16AAE; Wed, 21 Jan 2026 01:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768960153; bh=oKGgkeOqoUdvc+SeEA+WSkGW3Y47q2k3FiRPuXw/5dE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlOghALqYNbrakCXwrWPLVT48Vz97vTn4fQ1QGOxPDQm/V0Z59t8tbtBA0GYX0fib 3/Ldb/GHq+9/R661t/2TTnGwe7b85b/wltoDZKJKwXR4/nSC8hsBHy+wt3INklirnF TWBI7E2Rm2fe3JCZPlXH5ZP6S2m3SJ3QHvqKhoyhyIgKTZH4mPSAAH6t4yHNnT40os js4XWJPVosu4RDwxjOdOZrQyrNv45COmi9YLAEUhoRlLR2A2TVRKVXc9BB04WBeSwi mp2/MfzagVLZtpzm+G2WuhW6F4Nc8zRuTlvWMG7G53ui3zKlzlmb0OwHHrHq6ejPmR AWx7NTgfWpkng== From: Sasha Levin To: stable@vger.kernel.org Cc: Dragan Simic , Heiko Stuebner , Vinod Koul , Sasha Levin Subject: [PATCH 6.6.y 1/2] phy: phy-rockchip-inno-usb2: Use dev_err_probe() in the probe path Date: Tue, 20 Jan 2026 20:49:10 -0500 Message-ID: <20260121014911.1112178-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026012036-stock-spout-b6b1@gregkh> References: <2026012036-stock-spout-b6b1@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Dragan Simic [ Upstream commit 40452520850683f6771094ca218ff206d1fcb022 ] Improve error handling in the probe path by using function dev_err_probe() instead of function dev_err(), where appropriate. Signed-off-by: Dragan Simic Reviewed-by: Heiko Stuebner Link: https://lore.kernel.org/r/d4ccd9fc278fb46ea868406bf77811ee507f0e4e.1725524803.git.dsimic@manjaro.org Signed-off-by: Vinod Koul Stable-dep-of: e07dea3de508 ("phy: rockchip: inno-usb2: Fix a double free bug in rockchip_usb2phy_probe()") Signed-off-by: Sasha Levin --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index b982c3f0d4b56..afc6459926090 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -420,11 +420,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, @@ -434,10 +432,9 @@ static int rockchip_usb2phy_extcon_register(struct rockchip_usb2phy *rphy) return -ENOMEM; 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; @@ -1392,10 +1389,8 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) } 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); @@ -1415,8 +1410,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; } @@ -1453,8 +1447,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; } } -- 2.51.0