]> err.no Git - linux-2.6/commitdiff
[Blackfin] arch: dump the stack before printing out an error otherwise the stack...
authorMike Frysinger <vapier.adi@gmail.com>
Wed, 26 Mar 2008 00:34:23 +0000 (08:34 +0800)
committerBryan Wu <cooloney@kernel.org>
Wed, 26 Mar 2008 00:34:23 +0000 (08:34 +0800)
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/kernel/bfin_gpio.c

index 08788f7bbfbab2a39ed27b710c43ba43f074cabf..a09dc48050b4cde2391ad7780b16a26507a824f8 100644 (file)
@@ -821,10 +821,10 @@ int peripheral_request(unsigned short per, const char *label)
        local_irq_save(flags);
 
        if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
+               dump_stack();
                printk(KERN_ERR
                    "%s: Peripheral %d is already reserved as GPIO by %s !\n",
                       __FUNCTION__, ident, get_label(ident));
-               dump_stack();
                local_irq_restore(flags);
                return -EBUSY;
        }
@@ -848,10 +848,10 @@ int peripheral_request(unsigned short per, const char *label)
                if (cmp_label(ident, label) == 0)
                        goto anyway;
 
+                       dump_stack();
                        printk(KERN_ERR
                               "%s: Peripheral %d function %d is already reserved by %s !\n",
                               __FUNCTION__, ident, P_FUNCT2MUX(per), get_label(ident));
-                       dump_stack();
                        local_irq_restore(flags);
                        return -EBUSY;
                }
@@ -891,10 +891,10 @@ int peripheral_request(unsigned short per, const char *label)
        if (!check_gpio(ident)) {
 
        if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
+               dump_stack();
                printk(KERN_ERR
                       "%s: Peripheral %d is already reserved as GPIO by %s !\n",
                       __FUNCTION__, ident, get_label(ident));
-               dump_stack();
                local_irq_restore(flags);
                return -EBUSY;
        }
@@ -918,12 +918,12 @@ int peripheral_request(unsigned short per, const char *label)
                if (cmp_label(ident, label) == 0)
                        goto anyway;
 
+                       dump_stack();
                        printk(KERN_ERR
                               "%s: Peripheral %d function %d is already"
                               " reserved by %s !\n",
                               __FUNCTION__, ident, P_FUNCT2MUX(per),
                                get_label(ident));
-                       dump_stack();
                        local_irq_restore(flags);
                        return -EBUSY;
                }
@@ -1046,17 +1046,17 @@ int gpio_request(unsigned gpio, const char *label)
        }
 
        if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
+               dump_stack();
                printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n",
                         gpio, get_label(gpio));
-               dump_stack();
                local_irq_restore(flags);
                return -EBUSY;
        }
        if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
+               dump_stack();
                printk(KERN_ERR
                       "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
                       gpio, get_label(gpio));
-               dump_stack();
                local_irq_restore(flags);
                return -EBUSY;
        }
@@ -1082,8 +1082,8 @@ void gpio_free(unsigned gpio)
        local_irq_save(flags);
 
        if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
-               gpio_error(gpio);
                dump_stack();
+               gpio_error(gpio);
                local_irq_restore(flags);
                return;
        }