pwm: pxa: Propagate pwmchip_remove() error
authorThierry Reding <thierry.reding@avionic-design.de>
Mon, 2 Jul 2012 19:32:33 +0000 (21:32 +0200)
committerThierry Reding <thierry.reding@avionic-design.de>
Mon, 23 Jul 2012 11:23:59 +0000 (13:23 +0200)
If the pwmchip_remove() call fails, propagate the error to the driver's
remove callback. This is required to prevent the module from being
unloaded if a PWM provided by the driver is still in use.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
drivers/pwm/pwm-pxa.c

index a2be966d550d0e8fa789074eab19d39e62859e09..bd5867a1c70064db164836630b7f126c2eeb4afb 100644 (file)
@@ -190,8 +190,7 @@ static int __devexit pwm_remove(struct platform_device *pdev)
        if (chip == NULL)
                return -ENODEV;
 
-       pwmchip_remove(&chip->chip);
-       return 0;
+       return pwmchip_remove(&chip->chip);
 }
 
 static struct platform_driver pwm_driver = {