Commit f2a36a78 authored by Viorel Suman's avatar Viorel Suman Committed by Mark Brown

ASoC: fsl_audmix: remove "model" attribute

Use "of_device_id.data" to specify the machine driver
instead of "model" DTS attribute.
Signed-off-by: default avatarViorel Suman <viorel.suman@nxp.com>
Acked-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d04195b0
...@@ -445,13 +445,29 @@ static const struct regmap_config fsl_audmix_regmap_config = { ...@@ -445,13 +445,29 @@ static const struct regmap_config fsl_audmix_regmap_config = {
.cache_type = REGCACHE_FLAT, .cache_type = REGCACHE_FLAT,
}; };
static const struct of_device_id fsl_audmix_ids[] = {
{
.compatible = "fsl,imx8qm-audmix",
.data = "imx-audmix",
},
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, fsl_audmix_ids);
static int fsl_audmix_probe(struct platform_device *pdev) static int fsl_audmix_probe(struct platform_device *pdev)
{ {
struct fsl_audmix *priv; struct fsl_audmix *priv;
struct resource *res; struct resource *res;
const char *mdrv;
const struct of_device_id *of_id;
void __iomem *regs; void __iomem *regs;
int ret; int ret;
const char *sprop;
of_id = of_match_device(fsl_audmix_ids, &pdev->dev);
if (!of_id || !of_id->data)
return -EINVAL;
mdrv = of_id->data;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -487,19 +503,12 @@ static int fsl_audmix_probe(struct platform_device *pdev) ...@@ -487,19 +503,12 @@ static int fsl_audmix_probe(struct platform_device *pdev)
return ret; return ret;
} }
sprop = of_get_property(pdev->dev.of_node, "model", NULL); priv->pdev = platform_device_register_data(&pdev->dev, mdrv, 0, NULL,
if (sprop) { 0);
priv->pdev = platform_device_register_data(&pdev->dev, sprop, 0, if (IS_ERR(priv->pdev)) {
NULL, 0); ret = PTR_ERR(priv->pdev);
if (IS_ERR(priv->pdev)) { dev_err(&pdev->dev, "failed to register platform %s: %d\n",
ret = PTR_ERR(priv->pdev); mdrv, ret);
dev_err(&pdev->dev,
"failed to register platform %s: %d\n", sprop,
ret);
}
} else {
dev_err(&pdev->dev, "[model] attribute missing.\n");
ret = -EINVAL;
} }
return ret; return ret;
...@@ -553,12 +562,6 @@ static const struct dev_pm_ops fsl_audmix_pm = { ...@@ -553,12 +562,6 @@ static const struct dev_pm_ops fsl_audmix_pm = {
pm_runtime_force_resume) pm_runtime_force_resume)
}; };
static const struct of_device_id fsl_audmix_ids[] = {
{ .compatible = "fsl,imx8qm-audmix", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, fsl_audmix_ids);
static struct platform_driver fsl_audmix_driver = { static struct platform_driver fsl_audmix_driver = {
.probe = fsl_audmix_probe, .probe = fsl_audmix_probe,
.remove = fsl_audmix_remove, .remove = fsl_audmix_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment