]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/i2c/i2c-dev.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / i2c / i2c-dev.c
index af4491fa7e347c3059b50d6bf68d509cdb24ea5b..c171988a9f517d7009319674265c47a10859a8c3 100644 (file)
@@ -521,9 +521,9 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
                return PTR_ERR(i2c_dev);
 
        /* register this i2c device with the driver core */
-       i2c_dev->dev = device_create_drvdata(i2c_dev_class, &adap->dev,
-                                            MKDEV(I2C_MAJOR, adap->nr),
-                                            NULL, "i2c-%d", adap->nr);
+       i2c_dev->dev = device_create(i2c_dev_class, &adap->dev,
+                                    MKDEV(I2C_MAJOR, adap->nr), NULL,
+                                    "i2c-%d", adap->nr);
        if (IS_ERR(i2c_dev->dev)) {
                res = PTR_ERR(i2c_dev->dev);
                goto error;
@@ -583,8 +583,10 @@ static int __init i2c_dev_init(void)
                goto out;
 
        i2c_dev_class = class_create(THIS_MODULE, "i2c-dev");
-       if (IS_ERR(i2c_dev_class))
+       if (IS_ERR(i2c_dev_class)) {
+               res = PTR_ERR(i2c_dev_class);
                goto out_unreg_chrdev;
+       }
 
        res = i2c_add_driver(&i2cdev_driver);
        if (res)