mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user