diff options
-rw-r--r-- | drivers/i2c/i2c-dev.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index cf9381eae8da..909428af2b7e 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c | |||
@@ -416,8 +416,8 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap) | |||
416 | i2c_dev->dev = device_create(i2c_dev_class, &adap->dev, | 416 | i2c_dev->dev = device_create(i2c_dev_class, &adap->dev, |
417 | MKDEV(I2C_MAJOR, adap->nr), | 417 | MKDEV(I2C_MAJOR, adap->nr), |
418 | "i2c-%d", adap->nr); | 418 | "i2c-%d", adap->nr); |
419 | if (!i2c_dev->dev) { | 419 | if (IS_ERR(i2c_dev->dev)) { |
420 | res = -ENODEV; | 420 | res = PTR_ERR(i2c_dev->dev); |
421 | goto error; | 421 | goto error; |
422 | } | 422 | } |
423 | res = device_create_file(i2c_dev->dev, &dev_attr_name); | 423 | res = device_create_file(i2c_dev->dev, &dev_attr_name); |