[ALSA] aoa: platform function gpio: ignore errors from functions that don't exist
authorJohannes Berg <johannes@sipsolutions.net>
Tue, 25 Jul 2006 14:15:07 +0000 (16:15 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 3 Aug 2006 13:21:25 +0000 (15:21 +0200)
Sometimes we simply want to turn off or on everything, and when recently a
warning was added when a certain platform function can't be called, this
triggered all the time in those cases. This patch shows the warning only if
the error was different from the function not existing.
The alternative would be to not even try calling the function when it
doesn't exist by first checking which exist and then only calling those that
do, but that adds complexity that isn't necessary.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/aoa/core/snd-aoa-gpio-pmf.c

index 3d57fd1..2836c32 100644 (file)
@@ -18,7 +18,7 @@ static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
                                                        \
        if (unlikely(!rt)) return;                              \
        rc = pmf_call_function(rt->node, #name "-mute", &args); \
-       if (rc)                                                 \
+       if (rc && rc != -ENODEV)                                \
                printk(KERN_WARNING "pmf_gpio_set_" #name       \
                " failed, rc: %d\n", rc);                       \
        rt->implementation_private &= ~(1<<bit);                \