sound: Mark sound_setup() as optional
This method in the sound API is optional since some drivers can do this
when probing or as part of SoC init. Mark it as such.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
diff --git a/drivers/sound/sound-uclass.c b/drivers/sound/sound-uclass.c
index 2b83626..0676606 100644
--- a/drivers/sound/sound-uclass.c
+++ b/drivers/sound/sound-uclass.c
@@ -16,7 +16,7 @@
struct sound_ops *ops = sound_get_ops(dev);
if (!ops->setup)
- return -ENOSYS;
+ return 0;
return ops->setup(dev);
}
diff --git a/include/sound.h b/include/sound.h
index b7959cc..7d528c4 100644
--- a/include/sound.h
+++ b/include/sound.h
@@ -54,7 +54,7 @@
/* Operations for sound */
struct sound_ops {
/**
- * setup() - Set up to play a sound
+ * setup() - Set up to play a sound (optional)
*/
int (*setup)(struct udevice *dev);