|
@@ -7,7 +7,6 @@
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
-#include <linux/component.h>
|
|
|
|
#include <sound/soc.h>
|
|
#include <sound/soc.h>
|
|
#include <sound/soc.h>
|
|
#include <sound/soc.h>
|
|
#include <sound/soc-dapm.h>
|
|
#include <sound/soc-dapm.h>
|
|
@@ -561,14 +560,15 @@ static struct snd_soc_dai_driver q6asm_fe_dais[] = {
|
|
Q6ASM_FEDAI_DRIVER(8),
|
|
Q6ASM_FEDAI_DRIVER(8),
|
|
};
|
|
};
|
|
|
|
|
|
-static int q6asm_dai_bind(struct device *dev, struct device *master, void *data)
|
|
|
|
|
|
+static int q6asm_dai_probe(struct platform_device *pdev)
|
|
{
|
|
{
|
|
|
|
+ struct device *dev = &pdev->dev;
|
|
struct device_node *node = dev->of_node;
|
|
struct device_node *node = dev->of_node;
|
|
struct of_phandle_args args;
|
|
struct of_phandle_args args;
|
|
struct q6asm_dai_data *pdata;
|
|
struct q6asm_dai_data *pdata;
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
- pdata = kzalloc(sizeof(struct q6asm_dai_data), GFP_KERNEL);
|
|
|
|
|
|
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
|
|
if (!pdata)
|
|
if (!pdata)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
|
|
|
|
@@ -580,36 +580,10 @@ static int q6asm_dai_bind(struct device *dev, struct device *master, void *data)
|
|
|
|
|
|
dev_set_drvdata(dev, pdata);
|
|
dev_set_drvdata(dev, pdata);
|
|
|
|
|
|
- return snd_soc_register_component(dev, &q6asm_fe_dai_component,
|
|
|
|
|
|
+ return devm_snd_soc_register_component(dev, &q6asm_fe_dai_component,
|
|
q6asm_fe_dais,
|
|
q6asm_fe_dais,
|
|
ARRAY_SIZE(q6asm_fe_dais));
|
|
ARRAY_SIZE(q6asm_fe_dais));
|
|
}
|
|
}
|
|
-static void q6asm_dai_unbind(struct device *dev, struct device *master,
|
|
|
|
- void *data)
|
|
|
|
-{
|
|
|
|
- struct q6asm_dai_data *pdata = dev_get_drvdata(dev);
|
|
|
|
-
|
|
|
|
- snd_soc_unregister_component(dev);
|
|
|
|
-
|
|
|
|
- kfree(pdata);
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static const struct component_ops q6asm_dai_comp_ops = {
|
|
|
|
- .bind = q6asm_dai_bind,
|
|
|
|
- .unbind = q6asm_dai_unbind,
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-static int q6asm_dai_probe(struct platform_device *pdev)
|
|
|
|
-{
|
|
|
|
- return component_add(&pdev->dev, &q6asm_dai_comp_ops);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int q6asm_dai_dev_remove(struct platform_device *pdev)
|
|
|
|
-{
|
|
|
|
- component_del(&pdev->dev, &q6asm_dai_comp_ops);
|
|
|
|
- return 0;
|
|
|
|
-}
|
|
|
|
|
|
|
|
static const struct of_device_id q6asm_dai_device_id[] = {
|
|
static const struct of_device_id q6asm_dai_device_id[] = {
|
|
{ .compatible = "qcom,q6asm-dais" },
|
|
{ .compatible = "qcom,q6asm-dais" },
|
|
@@ -623,7 +597,6 @@ static struct platform_driver q6asm_dai_platform_driver = {
|
|
.of_match_table = of_match_ptr(q6asm_dai_device_id),
|
|
.of_match_table = of_match_ptr(q6asm_dai_device_id),
|
|
},
|
|
},
|
|
.probe = q6asm_dai_probe,
|
|
.probe = q6asm_dai_probe,
|
|
- .remove = q6asm_dai_dev_remove,
|
|
|
|
};
|
|
};
|
|
module_platform_driver(q6asm_dai_platform_driver);
|
|
module_platform_driver(q6asm_dai_platform_driver);
|
|
|
|
|