From nobody Tue Feb 10 00:38:51 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81385C77B73 for ; Mon, 22 May 2023 17:04:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233501AbjEVREI (ORCPT ); Mon, 22 May 2023 13:04:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbjEVRDr (ORCPT ); Mon, 22 May 2023 13:03:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6390DE9; Mon, 22 May 2023 10:03:46 -0700 (PDT) Received: from jupiter.universe (dyndsl-091-248-208-162.ewe-ip-backbone.de [91.248.208.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: sre) by madras.collabora.co.uk (Postfix) with ESMTPSA id 12A966606E72; Mon, 22 May 2023 18:03:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1684775025; bh=MWtwyGF7akcYO5s0qhuBRzsJ9ydw4HewyiQSd80e/Q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WaqvdF6ocAzkI463kXIOimiwSO1fUcnLllx8va5AKRDNr9vD6FVlUO2X8Mpbc1sZs ctecFb+keRzRcbLylk/SHTTO1Pejil6HHad66nLkksi2NgRp6Zji3frtgpziqLWFbE FWx0xJ4cJ0Yxhbj3xZtkE+/wFLUqGzgzW3vGf6q5SUNLY00sJDzZul8XmLi9GP9oG7 u+bGhBc9X2ykxMjwGUgDkt2R2WY9gQKT9nJ9Eht1TAy9SIey3lv6ox7hJ6N+CgZWbZ E16rhGV/aO6mUiFy0qcecULKTRZ6UsNYmWg2tgtssWvh5rF+IYvg0mWeV3wFqcF+Sw z4eUy8i/NrJyw== Received: by jupiter.universe (Postfix, from userid 1000) id 81CCD4807F0; Mon, 22 May 2023 19:03:40 +0200 (CEST) From: Sebastian Reichel To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski Cc: Heiko Stuebner , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Sebastian Reichel , kernel@collabora.com Subject: [PATCH v3 6/7] phy: phy-rockchip-inno-usb2: simplify getting match data Date: Mon, 22 May 2023 19:03:23 +0200 Message-Id: <20230522170324.61349-7-sebastian.reichel@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522170324.61349-1-sebastian.reichel@collabora.com> References: <20230522170324.61349-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Simplify the code by directly getting the match data via device_get_match_data() instead of open coding its functionality. Signed-off-by: Sebastian Reichel --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/ro= ckchip/phy-rockchip-inno-usb2.c index 1cf84869e78b..f5c30f117cba 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1305,7 +1305,6 @@ static int rockchip_usb2phy_probe(struct platform_dev= ice *pdev) struct phy_provider *provider; struct rockchip_usb2phy *rphy; const struct rockchip_usb2phy_cfg *phy_cfgs; - const struct of_device_id *match; unsigned int reg; int index, ret; =20 @@ -1313,12 +1312,6 @@ static int rockchip_usb2phy_probe(struct platform_de= vice *pdev) if (!rphy) return -ENOMEM; =20 - match =3D of_match_device(dev->driver->of_match_table, dev); - if (!match || !match->data) { - dev_err(dev, "phy configs are not assigned!\n"); - return -EINVAL; - } - if (!dev->parent || !dev->parent->of_node) { rphy->grf =3D syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf"); if (IS_ERR(rphy->grf)) { @@ -1359,12 +1352,15 @@ static int rockchip_usb2phy_probe(struct platform_d= evice *pdev) } =20 rphy->dev =3D dev; - phy_cfgs =3D match->data; + phy_cfgs =3D device_get_match_data(dev); rphy->chg_state =3D USB_CHG_STATE_UNDEFINED; rphy->chg_type =3D POWER_SUPPLY_TYPE_UNKNOWN; rphy->irq =3D platform_get_irq_optional(pdev, 0); platform_set_drvdata(pdev, rphy); =20 + if (!phy_cfgs) + return dev_err_probe(dev, -EINVAL, "phy configs are not assigned!\n"); + ret =3D rockchip_usb2phy_extcon_register(rphy); if (ret) return ret; --=20 2.39.2