]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/i2c/busses/i2c-s3c2410.c
Merge Paulus' tree
[karo-tx-linux.git] / drivers / i2c / busses / i2c-s3c2410.c
index a3b38257cc3d51e9f4d9ab826c03edd7173a4523..1b582262e677ed89ce68b9277e927d4f61046948 100644 (file)
@@ -33,7 +33,7 @@
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/err.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
 
 #include <asm/hardware.h>
 #include <asm/irq.h>
@@ -568,7 +568,6 @@ static u32 s3c24xx_i2c_func(struct i2c_adapter *adap)
 /* i2c bus registration info */
 
 static struct i2c_algorithm s3c24xx_i2c_algorithm = {
-       .name                   = "S3C2410-I2C-Algorithm",
        .master_xfer            = s3c24xx_i2c_xfer,
        .functionality          = s3c24xx_i2c_func,
 };
@@ -880,14 +879,12 @@ static int s3c24xx_i2c_remove(struct device *dev)
 }
 
 #ifdef CONFIG_PM
-static int s3c24xx_i2c_resume(struct device *dev, u32 level)
+static int s3c24xx_i2c_resume(struct device *dev)
 {
        struct s3c24xx_i2c *i2c = dev_get_drvdata(dev);
-       
-       if (i2c != NULL && level == RESUME_ENABLE) {
-               dev_dbg(dev, "resume: level %d\n", level);
+
+       if (i2c != NULL)
                s3c24xx_i2c_init(i2c);
-       }
 
        return 0;
 }
@@ -899,6 +896,7 @@ static int s3c24xx_i2c_resume(struct device *dev, u32 level)
 /* device driver for platform bus bits */
 
 static struct device_driver s3c2410_i2c_driver = {
+       .owner          = THIS_MODULE,
        .name           = "s3c2410-i2c",
        .bus            = &platform_bus_type,
        .probe          = s3c24xx_i2c_probe,
@@ -907,6 +905,7 @@ static struct device_driver s3c2410_i2c_driver = {
 };
 
 static struct device_driver s3c2440_i2c_driver = {
+       .owner          = THIS_MODULE,
        .name           = "s3c2440-i2c",
        .bus            = &platform_bus_type,
        .probe          = s3c24xx_i2c_probe,
@@ -919,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;
 }