[DRIVER MODEL] Add missing driver_unregister in i2c-s3c2410 failure path.
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sun, 30 Oct 2005 16:32:27 +0000 (16:32 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 30 Oct 2005 16:32:27 +0000 (16:32 +0000)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/i2c/busses/i2c-s3c2410.c

index a1268e534254245ee7eb2eab08202808922bd94d..1b582262e677ed89ce68b9277e927d4f61046948 100644 (file)
@@ -918,8 +918,11 @@ static int __init i2c_adap_s3c_init(void)
        int ret;
 
        ret = driver_register(&s3c2410_i2c_driver);
-       if (ret == 0)
-               ret = driver_register(&s3c2440_i2c_driver); 
+       if (ret == 0) {
+               ret = driver_register(&s3c2440_i2c_driver);
+               if (ret)
+                       driver_unregister(&s3c2410_i2c_driver);
+       }
 
        return ret;
 }