From: Heiko Stuebner <heiko@sntech.de>
To: Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Rob Herring <robh@kernel.org>
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 [thread overview]
Message-ID: <7578192.EvYhyI6sBW@phil> (raw)
In-Reply-To: <20231009172923.2457844-15-robh@kernel.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 <robh@kernel.org>
> ---
> drivers/phy/rockchip/phy-rockchip-pcie.c | 11 ++++-------
> drivers/phy/rockchip/phy-rockchip-usb.c | 10 +++-------
For the Rockchip part:
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> 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 <linux/mfd/syscon.h>
> #include <linux/module.h>
> #include <linux/of.h>
> -#include <linux/of_address.h>
> -#include <linux/of_platform.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/regmap.h>
> #include <linux/reset.h>
>
> @@ -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 <linux/module.h>
> #include <linux/mutex.h>
> #include <linux/of.h>
> -#include <linux/of_address.h>
> -#include <linux/of_platform.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/regulator/consumer.h>
> #include <linux/reset.h>
> #include <linux/regmap.h>
> @@ -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-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-10-09 20:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 17:29 [PATCH] phy: Use device_get_match_data() Rob Herring
2023-10-09 20:13 ` Heiko Stuebner [this message]
2023-10-13 10:43 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7578192.EvYhyI6sBW@phil \
--to=heiko@sntech.de \
--cc=kishon@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=robh@kernel.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).