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.

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/20231006213854.333261-1-robh@kernel.org/
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Rob Herring and committed by
Chanwoo Choi
e50fa1a5 41982740

+3 -10
+3 -10
drivers/devfreq/event/exynos-ppmu.c
··· 12 12 #include <linux/io.h> 13 13 #include <linux/kernel.h> 14 14 #include <linux/module.h> 15 - #include <linux/of_address.h> 16 - #include <linux/of_device.h> 15 + #include <linux/of.h> 17 16 #include <linux/platform_device.h> 17 + #include <linux/property.h> 18 18 #include <linux/regmap.h> 19 19 #include <linux/suspend.h> 20 20 #include <linux/devfreq-event.h> ··· 507 507 struct device *dev = info->dev; 508 508 struct device_node *events_np, *node; 509 509 int i, j, count; 510 - const struct of_device_id *of_id; 511 510 int ret; 512 511 513 512 events_np = of_get_child_by_name(np, "events"); ··· 524 525 } 525 526 info->num_events = count; 526 527 527 - of_id = of_match_device(exynos_ppmu_id_match, dev); 528 - if (of_id) 529 - info->ppmu_type = (enum exynos_ppmu_type)of_id->data; 530 - else { 531 - of_node_put(events_np); 532 - return -EINVAL; 533 - } 528 + info->ppmu_type = (enum exynos_ppmu_type)device_get_match_data(dev); 534 529 535 530 j = 0; 536 531 for_each_child_of_node(events_np, node) {