mfd: Avoid calling platform_device_put() twice in ucb1400 probe error path
authorAxel Lin <axel.lin@gmail.com>
Tue, 3 Aug 2010 08:34:13 +0000 (16:34 +0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 12 Aug 2010 09:28:06 +0000 (11:28 +0200)
In the case of goto err2, what we want is to call
platform_device_del() instead of platform_device_unregister().
Otherwise, we call platform_device_put() twice.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/ucb1400_core.c

index dbe280153f9e769d2c24d9211c5768587c8fb78c..d73f84ba0f08b364e484d0b26c17ce0d255c2cd9 100644 (file)
@@ -114,7 +114,7 @@ static int ucb1400_core_probe(struct device *dev)
 err3:
        platform_device_put(ucb->ucb1400_ts);
 err2:
-       platform_device_unregister(ucb->ucb1400_gpio);
+       platform_device_del(ucb->ucb1400_gpio);
 err1:
        platform_device_put(ucb->ucb1400_gpio);
 err0: