phy: rockchip: csi2_dphy: Use device_get_match_data()

Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data in a single step.

Change-Id: I770517a2c472135c334719d677f474e345ede4aa
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang
2025-01-31 12:08:22 +08:00
parent fb17b1766f
commit feb9df207e

View File

@@ -14,6 +14,7 @@
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
#include <media/media-entity.h>
@@ -1178,7 +1179,6 @@ static int rockchip_csi2_dphy_hw_probe(struct platform_device *pdev)
struct csi2_dphy_hw *dphy_hw;
struct regmap *grf;
struct resource *res;
const struct of_device_id *of_id;
const struct dphy_hw_drv_data *drv_data;
dphy_hw = devm_kzalloc(dev, sizeof(*dphy_hw), GFP_KERNEL);
@@ -1186,12 +1186,10 @@ static int rockchip_csi2_dphy_hw_probe(struct platform_device *pdev)
return -ENOMEM;
dphy_hw->dev = dev;
of_id = of_match_device(rockchip_csi2_dphy_hw_match_id, dev);
if (!of_id)
drv_data = device_get_match_data(dev);
if (!drv_data)
return -EINVAL;
drv_data = of_id->data;
grf = syscon_regmap_lookup_by_phandle(dev->of_node,
"rockchip,grf");
if (IS_ERR(grf)) {