summaryrefslogtreecommitdiffstats
path: root/sound/soc/qcom
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-06 22:09:14 +0200
committerMark Brown <broonie@kernel.org>2023-10-09 14:13:59 +0200
commit9958d85968ed2df4b704105fd2a9c3669eb9cd97 (patch)
tree6b7e35136e317d6546930b369159e1dca2468ad6 /sound/soc/qcom
parentASoC: qcom/lpass: Constify struct lpass_variant (diff)
downloadlinux-9958d85968ed2df4b704105fd2a9c3669eb9cd97.tar.xz
linux-9958d85968ed2df4b704105fd2a9c3669eb9cd97.zip
ASoC: 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/20231006-dt-asoc-header-cleanups-v3-5-13a4f0f7fee6@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/qcom')
-rw-r--r--sound/soc/qcom/lpass-cpu.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 18aff2654f89..ac0feb89b458 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -9,7 +9,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -1106,7 +1105,6 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
struct resource *res;
const struct lpass_variant *variant;
struct device *dev = &pdev->dev;
- const struct of_device_id *match;
int ret, i, dai_id;
dsp_of_node = of_parse_phandle(pdev->dev.of_node, "qcom,adsp", 0);
@@ -1121,17 +1119,14 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, drvdata);
- match = of_match_device(dev->driver->of_match_table, dev);
- if (!match || !match->data)
+ variant = device_get_match_data(dev);
+ if (!variant)
return -EINVAL;
- if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016")) {
- dev_warn(dev, "%s compatible is deprecated\n",
- match->compatible);
- }
+ if (of_device_is_compatible(dev->of_node, "qcom,lpass-cpu-apq8016"))
+ dev_warn(dev, "qcom,lpass-cpu-apq8016 compatible is deprecated\n");
- drvdata->variant = (struct lpass_variant *)match->data;
- variant = drvdata->variant;
+ drvdata->variant = variant;
of_lpass_cpu_parse_dai_data(dev, drvdata);