summaryrefslogtreecommitdiffstats
path: root/drivers/pmdomain/actions
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-07 00:46:13 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2023-10-17 11:45:11 +0200
commit3ba9fdfaa550936837b50b73d6c27ac401fde875 (patch)
tree4f23007dd97ec35608b6c85ab376fbeb6eca5e69 /drivers/pmdomain/actions
parentpmdomain: Merge branch fixes into next (diff)
downloadlinux-3ba9fdfaa550936837b50b73d6c27ac401fde875.tar.xz
linux-3ba9fdfaa550936837b50b73d6c27ac401fde875.zip
pmdomain: 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. Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20231006224614.444488-1-robh@kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/pmdomain/actions')
-rw-r--r--drivers/pmdomain/actions/owl-sps.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/pmdomain/actions/owl-sps.c b/drivers/pmdomain/actions/owl-sps.c
index 73a9e0bb7e8e..3a586d1f3256 100644
--- a/drivers/pmdomain/actions/owl-sps.c
+++ b/drivers/pmdomain/actions/owl-sps.c
@@ -8,8 +8,10 @@
* Copyright (c) 2017 Andreas Färber
*/
+#include <linux/mod_devicetable.h>
#include <linux/of_address.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/pm_domain.h>
#include <linux/soc/actions/owl-sps.h>
#include <dt-bindings/power/owl-s500-powergate.h>
@@ -96,24 +98,16 @@ static int owl_sps_init_domain(struct owl_sps *sps, int index)
static int owl_sps_probe(struct platform_device *pdev)
{
- const struct of_device_id *match;
const struct owl_sps_info *sps_info;
struct owl_sps *sps;
int i, ret;
- if (!pdev->dev.of_node) {
- dev_err(&pdev->dev, "no device node\n");
- return -ENODEV;
- }
-
- match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev);
- if (!match || !match->data) {
+ sps_info = device_get_match_data(&pdev->dev);
+ if (!sps_info) {
dev_err(&pdev->dev, "unknown compatible or missing data\n");
return -EINVAL;
}
- sps_info = match->data;
-
sps = devm_kzalloc(&pdev->dev,
struct_size(sps, domains, sps_info->num_domains),
GFP_KERNEL);