]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sound: Mark sound_setup() as optional
authorSimon Glass <sjg@chromium.org>
Sun, 17 Feb 2019 03:24:53 +0000 (20:24 -0700)
committerBin Meng <bmeng.cn@gmail.com>
Wed, 20 Feb 2019 07:27:08 +0000 (15:27 +0800)
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>
drivers/sound/sound-uclass.c
include/sound.h

index 2b836268896e1b962497b10b29ffcd18da09c86b..067660623b2b81666af67480be7742dc04937de4 100644 (file)
@@ -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);
 }
index b7959cc260751da14009146858c3b0b4e1def955..7d528c479efb1cab041981a9c157ea8ad0375aae 100644 (file)
@@ -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);