From mboxrd@z Thu Jan 1 00:00:00 1970 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 AAB3BCD6133 for ; Mon, 9 Oct 2023 20:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KVrpQIfVx4u+RMF4ecgEEEZ+ytyGHsoLscehyIxsuME=; b=iAp5hW5U64j20D sCbqPMWqBiVwm7vTFYc3K+Aw/f+luVotvrL3etYsSBnTN/mP4V1wRFQ3vVpqCh50oRV7D17yXOECD MNYNUFVdUNFcfbC7y2uYykisBg7Ly4nbjU2r2ZBk/1hZeZ9YiuFHJuOxo84JfKAPrgb9Yj3ojGgv8 X/TnybJbltcMX5a35FEePuRBB53AfWbttR/SNmW4GcVQ1/nmN8KMvcyHsmWeaEUz4aL+qWFPaRlUx 0BrH8sgsEwlPngs5IJFF6fH1/o50lp+nRIT3e8VEvtisrtPxnTk6KSHeYcJ+RkUY/XHz1z3KaNK1Q tHeHNj/OmMLVZAoa1Dfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qpwd0-00BYXk-1M; Mon, 09 Oct 2023 20:13:22 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qpwcx-00BYX3-2d; Mon, 09 Oct 2023 20:13:21 +0000 Received: from [194.95.143.137] (helo=phil.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qpwcs-0004w0-5H; Mon, 09 Oct 2023 22:13:14 +0200 From: Heiko Stuebner To: Vinod Koul , Kishon Vijay Abraham I , Rob Herring Cc: linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH] phy: Use device_get_match_data() Date: Mon, 09 Oct 2023 22:13:13 +0200 Message-ID: <7578192.EvYhyI6sBW@phil> In-Reply-To: <20231009172923.2457844-15-robh@kernel.org> References: <20231009172923.2457844-15-robh@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231009_131319_879809_8436DA5F X-CRM114-Status: GOOD ( 17.34 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org Am Montag, 9. Oktober 2023, 19:29:10 CEST schrieb Rob Herring: > Use preferred device_get_match_data() instead of of_match_device() to > get the driver match data. With this, adjust the includes to explicitly > include the correct headers. > > Signed-off-by: Rob Herring > --- > drivers/phy/rockchip/phy-rockchip-pcie.c | 11 ++++------- > drivers/phy/rockchip/phy-rockchip-usb.c | 10 +++------- For the Rockchip part: Reviewed-by: Heiko Stuebner > diff --git a/drivers/phy/rockchip/phy-rockchip-pcie.c b/drivers/phy/rockchip/phy-rockchip-pcie.c > index 8234b83fdd88..1bbd6be2a584 100644 > --- a/drivers/phy/rockchip/phy-rockchip-pcie.c > +++ b/drivers/phy/rockchip/phy-rockchip-pcie.c > @@ -12,10 +12,9 @@ > #include > #include > #include > -#include > -#include > #include > #include > +#include > #include > #include > > @@ -63,7 +62,7 @@ struct rockchip_pcie_data { > }; > > struct rockchip_pcie_phy { > - struct rockchip_pcie_data *phy_data; > + const struct rockchip_pcie_data *phy_data; > struct regmap *reg_base; > struct phy_pcie_instance { > struct phy *phy; > @@ -350,7 +349,6 @@ static int rockchip_pcie_phy_probe(struct platform_device *pdev) > struct rockchip_pcie_phy *rk_phy; > struct phy_provider *phy_provider; > struct regmap *grf; > - const struct of_device_id *of_id; > int i; > u32 phy_num; > > @@ -364,11 +362,10 @@ static int rockchip_pcie_phy_probe(struct platform_device *pdev) > if (!rk_phy) > return -ENOMEM; > > - of_id = of_match_device(rockchip_pcie_phy_dt_ids, &pdev->dev); > - if (!of_id) > + rk_phy->phy_data = device_get_match_data(&pdev->dev); > + if (!rk_phy->phy_data) > return -EINVAL; > > - rk_phy->phy_data = (struct rockchip_pcie_data *)of_id->data; > rk_phy->reg_base = grf; > > mutex_init(&rk_phy->pcie_mutex); > diff --git a/drivers/phy/rockchip/phy-rockchip-usb.c b/drivers/phy/rockchip/phy-rockchip-usb.c > index 8454285977eb..666a896c8f0a 100644 > --- a/drivers/phy/rockchip/phy-rockchip-usb.c > +++ b/drivers/phy/rockchip/phy-rockchip-usb.c > @@ -13,10 +13,9 @@ > #include > #include > #include > -#include > -#include > #include > #include > +#include > #include > #include > #include > @@ -458,7 +457,6 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev) > struct device *dev = &pdev->dev; > struct rockchip_usb_phy_base *phy_base; > struct phy_provider *phy_provider; > - const struct of_device_id *match; > struct device_node *child; > int err; > > @@ -466,14 +464,12 @@ static int rockchip_usb_phy_probe(struct platform_device *pdev) > if (!phy_base) > return -ENOMEM; > > - match = of_match_device(dev->driver->of_match_table, dev); > - if (!match || !match->data) { > + phy_base->pdata = device_get_match_data(dev); > + if (!phy_base->pdata) { > dev_err(dev, "missing phy data\n"); > return -EINVAL; > } > > - phy_base->pdata = match->data; > - > phy_base->dev = dev; > phy_base->reg_base = ERR_PTR(-ENODEV); > if (dev->parent && dev->parent->of_node) -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy