soc: rockchip: pvtm: 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: I1db708801f98f00e92f30b690ec0f222d14420d7
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang
2025-01-31 13:11:01 +08:00
parent 23ab749adc
commit d8dc4af9d9

View File

@@ -17,6 +17,7 @@
#include <linux/of_clk.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/slab.h>
@@ -983,13 +984,13 @@ static int rockchip_pvtm_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = pdev->dev.of_node;
struct device_node *node;
const struct of_device_id *match;
const struct rockchip_pvtm_data *data;
struct rockchip_pvtm *pvtm;
struct regmap *grf = NULL;
void __iomem *base = NULL;
match = of_match_device(dev->driver->of_match_table, dev);
if (!match || !match->data) {
data = device_get_match_data(dev);
if (!data) {
dev_err(dev, "missing pvtm data\n");
return -EINVAL;
}
@@ -1005,7 +1006,7 @@ static int rockchip_pvtm_probe(struct platform_device *pdev)
}
for_each_available_child_of_node(np, node) {
pvtm = rockchip_pvtm_init(dev, node, match->data, grf, base);
pvtm = rockchip_pvtm_init(dev, node, data, grf, base);
if (!pvtm) {
dev_err(dev, "failed to handle node %s\n",
node->full_name);