Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36104
b: refs/heads/master
c: b32d20d
h: refs/heads/master
v: v3
  • Loading branch information
Jean Delvare authored and Greg Kroah-Hartman committed Sep 26, 2006
1 parent 9bf5d45 commit 9a44374
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a8d29cec7a53cf1a29dc5055aa9d1fa0f95830f
refs/heads/master: b32d20dc8b187e03605f091dbde9a78676a2a642
10 changes: 5 additions & 5 deletions trunk/drivers/i2c/i2c-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,6 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
if (IS_ERR(i2c_dev))
return PTR_ERR(i2c_dev);

pr_debug("i2c-dev: adapter [%s] registered as minor %d\n",
adap->name, adap->nr);

/* register this i2c device with the driver core */
i2c_dev->class_dev = class_device_create(i2c_dev_class, NULL,
MKDEV(I2C_MAJOR, adap->nr),
Expand All @@ -427,6 +424,9 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
res = class_device_create_file(i2c_dev->class_dev, &class_device_attr_name);
if (res)
goto error_destroy;

pr_debug("i2c-dev: adapter [%s] registered as minor %d\n",
adap->name, adap->nr);
return 0;
error_destroy:
class_device_destroy(i2c_dev_class, MKDEV(I2C_MAJOR, adap->nr));
Expand All @@ -441,8 +441,8 @@ static int i2cdev_detach_adapter(struct i2c_adapter *adap)
struct i2c_dev *i2c_dev;

i2c_dev = i2c_dev_get_by_minor(adap->nr);
if (!i2c_dev)
return -ENODEV;
if (!i2c_dev) /* attach_adapter must have failed */
return 0;

class_device_remove_file(i2c_dev->class_dev, &class_device_attr_name);
return_i2c_dev(i2c_dev);
Expand Down

0 comments on commit 9a44374

Please sign in to comment.