[PATCH] aoa: pmf gpio: report if function calling fails
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 10 Jul 2006 11:44:37 +0000 (04:44 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Jul 2006 20:24:19 +0000 (13:24 -0700)
This patch makes the pmf GPIO layer in aoa report if calling a platform
function failed.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
sound/aoa/core/snd-aoa-gpio-pmf.c

index 0e9b9bb2a6de06a48c7666dbee40ab08f4cd5c90..3d57fd1aec4b6888c6d4664015404425143c6285 100644 (file)
 static void pmf_gpio_set_##name(struct gpio_runtime *rt, int on)\
 {                                                              \
        struct pmf_args args = { .count = 1, .u[0].v = !on };   \
-                                                               \
+       int rc;                                                 \
+                                                       \
        if (unlikely(!rt)) return;                              \
-       pmf_call_function(rt->node, #name "-mute", &args);      \
+       rc = pmf_call_function(rt->node, #name "-mute", &args); \
+       if (rc)                                                 \
+               printk(KERN_WARNING "pmf_gpio_set_" #name       \
+               " failed, rc: %d\n", rc);                       \
        rt->implementation_private &= ~(1<<bit);                \
        rt->implementation_private |= (!!on << bit);            \
 }                                                              \
@@ -33,9 +37,13 @@ PMF_GPIO(lineout, 2);
 static void pmf_gpio_set_hw_reset(struct gpio_runtime *rt, int on)
 {
        struct pmf_args args = { .count = 1, .u[0].v = !!on };
+       int rc;
 
        if (unlikely(!rt)) return;
-       pmf_call_function(rt->node, "hw-reset", &args);
+       rc = pmf_call_function(rt->node, "hw-reset", &args);
+       if (rc)
+               printk(KERN_WARNING "pmf_gpio_set_hw_reset"
+                      " failed, rc: %d\n", rc);
 }
 
 static void pmf_gpio_all_amps_off(struct gpio_runtime *rt)