summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorSven Wegener <sven.wegener@stealer.net>2008-09-24 15:39:21 +0400
committerJean Delvare <khali@mahadeva.delvare>2008-09-24 15:39:21 +0400
commite74783ec3cb981211689bd2cfd3248f8dc48ec01 (patch)
tree0835a0ade974c7a77ef6534038a85537ca5f6c2a /drivers/i2c
parent4ebb52d34fac2904e541ccfa8e32126db836fa92 (diff)
downloadlinux-e74783ec3cb981211689bd2cfd3248f8dc48ec01.tar.xz
i2c-dev: Return correct error code on class_create() failure
We need to convert the error pointer from class_create(), else we'll return the successful return code from register_chrdev() on failure. Signed-off-by: Sven Wegener <sven.wegener@stealer.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-dev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index af4491fa7e34..307d976c9b69 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -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)