Skip to content

Commit e50fa1a

Browse files
robherringchanwoochoi
authored andcommitted
PM / devfreq: exynos-ppmu: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent 4198274 commit e50fa1a

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

drivers/devfreq/event/exynos-ppmu.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#include <linux/io.h>
1313
#include <linux/kernel.h>
1414
#include <linux/module.h>
15-
#include <linux/of_address.h>
16-
#include <linux/of_device.h>
15+
#include <linux/of.h>
1716
#include <linux/platform_device.h>
17+
#include <linux/property.h>
1818
#include <linux/regmap.h>
1919
#include <linux/suspend.h>
2020
#include <linux/devfreq-event.h>
@@ -507,7 +507,6 @@ static int of_get_devfreq_events(struct device_node *np,
507507
struct device *dev = info->dev;
508508
struct device_node *events_np, *node;
509509
int i, j, count;
510-
const struct of_device_id *of_id;
511510
int ret;
512511

513512
events_np = of_get_child_by_name(np, "events");
@@ -525,13 +524,7 @@ static int of_get_devfreq_events(struct device_node *np,
525524
}
526525
info->num_events = count;
527526

528-
of_id = of_match_device(exynos_ppmu_id_match, dev);
529-
if (of_id)
530-
info->ppmu_type = (enum exynos_ppmu_type)of_id->data;
531-
else {
532-
of_node_put(events_np);
533-
return -EINVAL;
534-
}
527+
info->ppmu_type = (enum exynos_ppmu_type)device_get_match_data(dev);
535528

536529
j = 0;
537530
for_each_child_of_node(events_np, node) {

0 commit comments

Comments
 (0)