gpio: Fix sch_gpio warning
authorSamuel Ortiz <sameo@linux.intel.com>
Fri, 5 Mar 2010 16:14:01 +0000 (17:14 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 7 Mar 2010 21:17:37 +0000 (22:17 +0100)
We need to check for gpiochip_remove() errors.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/gpio/sch_gpio.c

index 761071ae35962f6ee9cadd7826d2655d39ebb976..583521352c16d7a24e4d039e8218ccfde835e940 100644 (file)
@@ -229,7 +229,10 @@ static int __devinit sch_gpio_probe(struct platform_device *pdev)
        return 0;
 
 err_sch_gpio_resume:
-       gpiochip_remove(&sch_gpio_core);
+       err = gpiochip_remove(&sch_gpio_core);
+       if (err)
+               dev_err(&pdev->dev, "%s failed, %d\n",
+                               "gpiochip_remove()", err);
 
 err_sch_gpio_core:
        release_region(res->start, resource_size(res));
@@ -242,13 +245,23 @@ static int __devexit sch_gpio_remove(struct platform_device *pdev)
 {
        struct resource *res;
        if (gpio_ba) {
-               gpiochip_remove(&sch_gpio_core);
-               gpiochip_remove(&sch_gpio_resume);
+               int err;
+
+               err  = gpiochip_remove(&sch_gpio_core);
+               if (err)
+                       dev_err(&pdev->dev, "%s failed, %d\n",
+                               "gpiochip_remove()", err);
+               err = gpiochip_remove(&sch_gpio_resume);
+               if (err)
+                       dev_err(&pdev->dev, "%s failed, %d\n",
+                               "gpiochip_remove()", err);
 
                res = platform_get_resource(pdev, IORESOURCE_IO, 0);
 
                release_region(res->start, resource_size(res));
                gpio_ba = 0;
+
+               return err;
        }
 
        return 0;