Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Minghao Chi (CGEL ZTE) and committed by
Vinod Koul
3eb836df 8585b1be

+1 -6
+1 -6
drivers/phy/rockchip/phy-rockchip-dphy-rx0.c
··· 327 327 struct device_node *np = dev->of_node; 328 328 const struct rk_dphy_drv_data *drv_data; 329 329 struct phy_provider *phy_provider; 330 - const struct of_device_id *of_id; 331 330 struct rk_dphy *priv; 332 331 struct phy *phy; 333 332 unsigned int i; ··· 346 347 return -ENODEV; 347 348 } 348 349 349 - of_id = of_match_device(rk_dphy_dt_ids, dev); 350 - if (!of_id) 351 - return -EINVAL; 352 - 353 - drv_data = of_id->data; 350 + drv_data = of_device_get_match_data(dev); 354 351 priv->drv_data = drv_data; 355 352 priv->clks = devm_kcalloc(&pdev->dev, drv_data->num_clks, 356 353 sizeof(*priv->clks), GFP_KERNEL);