diff options
author | Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn> | 2022-03-03 02:44:06 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2022-04-13 11:53:23 +0200 |
commit | 3eb836df4da779c0e42946b02b1cc61dbf7e8622 (patch) | |
tree | f04dee2441b4334530ac5705b75d23a176512837 /drivers/phy/rockchip | |
parent | phy: qcom-qmp: Add support for SDX65 QMP PHY (diff) | |
download | linux-3eb836df4da779c0e42946b02b1cc61dbf7e8622.tar.xz linux-3eb836df4da779c0e42946b02b1cc61dbf7e8622.zip |
phy/rockchip: Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220303014406.2059140-1-chi.minghao@zte.com.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/phy/rockchip')
-rw-r--r-- | drivers/phy/rockchip/phy-rockchip-dphy-rx0.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/phy/rockchip/phy-rockchip-dphy-rx0.c b/drivers/phy/rockchip/phy-rockchip-dphy-rx0.c index 4df9476ef2a9..639452f47869 100644 --- a/drivers/phy/rockchip/phy-rockchip-dphy-rx0.c +++ b/drivers/phy/rockchip/phy-rockchip-dphy-rx0.c @@ -327,7 +327,6 @@ static int rk_dphy_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; const struct rk_dphy_drv_data *drv_data; struct phy_provider *phy_provider; - const struct of_device_id *of_id; struct rk_dphy *priv; struct phy *phy; unsigned int i; @@ -347,11 +346,7 @@ static int rk_dphy_probe(struct platform_device *pdev) return -ENODEV; } - of_id = of_match_device(rk_dphy_dt_ids, dev); - if (!of_id) - return -EINVAL; - - drv_data = of_id->data; + drv_data = of_device_get_match_data(dev); priv->drv_data = drv_data; priv->clks = devm_kcalloc(&pdev->dev, drv_data->num_clks, sizeof(*priv->clks), GFP_KERNEL); |