// Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
// Liam Girdwood <lrg@slimlogic.co.uk>
-#include <linux/platform_device.h>
+#include <linux/device/faux.h>
#include <linux/export.h>
#include <linux/math.h>
#include <sound/core.h>
};
EXPORT_SYMBOL_GPL(snd_soc_dummy_dlc);
-static int snd_soc_dummy_probe(struct platform_device *pdev)
+static int snd_soc_dummy_probe(struct faux_device *fdev)
{
int ret;
- ret = devm_snd_soc_register_component(&pdev->dev,
+ ret = devm_snd_soc_register_component(&fdev->dev,
&dummy_codec, &dummy_dai, 1);
if (ret < 0)
return ret;
- ret = devm_snd_soc_register_component(&pdev->dev, &dummy_platform,
+ ret = devm_snd_soc_register_component(&fdev->dev, &dummy_platform,
NULL, 0);
return ret;
}
-static struct platform_driver soc_dummy_driver = {
- .driver = {
- .name = "snd-soc-dummy",
- },
+static struct faux_device_ops soc_dummy_ops = {
.probe = snd_soc_dummy_probe,
};
-static struct platform_device *soc_dummy_dev;
+static struct faux_device *soc_dummy_dev;
int __init snd_soc_util_init(void)
{
- int ret;
-
- soc_dummy_dev =
- platform_device_register_simple("snd-soc-dummy", -1, NULL, 0);
- if (IS_ERR(soc_dummy_dev))
- return PTR_ERR(soc_dummy_dev);
+ soc_dummy_dev = faux_device_create("snd-soc-dummy", NULL,
+ &soc_dummy_ops);
+ if (!soc_dummy_dev)
+ return -ENODEV;
- ret = platform_driver_register(&soc_dummy_driver);
- if (ret != 0)
- platform_device_unregister(soc_dummy_dev);
-
- return ret;
+ return 0;
}
void snd_soc_util_exit(void)
{
- platform_driver_unregister(&soc_dummy_driver);
- platform_device_unregister(soc_dummy_dev);
+ faux_device_destroy(soc_dummy_dev);
}