Message ID | 20100208130248.72febd68.akpm@linux-foundation.org (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Grant Likely |
Headers | show |
diff -puN drivers/of/gpio.c~of-gpio-implement-gpiolib-notifier-hooks-fix drivers/of/gpio.c --- a/drivers/of/gpio.c~of-gpio-implement-gpiolib-notifier-hooks-fix +++ a/drivers/of/gpio.c @@ -255,10 +255,8 @@ static int of_gpiochip_register_simple(s { struct of_gpio_chip *of_gc; - if (np->data) { - WARN_ON(1); + if (WARN_ON(np->data)) return -EBUSY; - } of_gc = kzalloc(sizeof(*of_gc), GFP_KERNEL); if (!of_gc) @@ -287,10 +285,8 @@ static int of_gpiochip_unregister(struct { struct of_gpio_chip *of_gc = np->data; - if (!of_gc || of_gc->chip != chip) { - WARN_ON(1); + if (WARN_ON(!of_gc || of_gc->chip != chip)) return -EINVAL; - } np->data = NULL; kfree(of_gc);