[U-Boot] [PATCH v2 20/34] sound: Mark sound_setup() as optional

Simon Glass sjg at chromium.org
Sun Feb 17 03:24:53 UTC 2019


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 at chromium.org>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
---

Changes in v2: None

 drivers/sound/sound-uclass.c | 2 +-
 include/sound.h              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/sound/sound-uclass.c b/drivers/sound/sound-uclass.c
index 2b836268896..067660623b2 100644
--- a/drivers/sound/sound-uclass.c
+++ b/drivers/sound/sound-uclass.c
@@ -16,7 +16,7 @@ int sound_setup(struct udevice *dev)
 	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 b7959cc2607..7d528c479ef 100644
--- a/include/sound.h
+++ b/include/sound.h
@@ -54,7 +54,7 @@ void sound_create_square_wave(uint sample_rate, unsigned short *data, int size,
 /* 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);
 
-- 
2.21.0.rc0.258.g878e2cd30e-goog



More information about the U-Boot mailing list