diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-28 00:13:53 +0200 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-28 00:13:53 +0200 |
commit | aebb1153ac54ddbbd3d3f0481a193f4bf0ead53b (patch) | |
tree | 57425aa83c8bed5b41af7e3408024fe1f2fdded9 /drivers/i2c/chips/eeprom.c | |
parent | Merge branch 'upstream' of git://lost.foo-projects.org/~ahkok/git/netdev-2.6 ... (diff) | |
parent | Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/... (diff) | |
download | linux-aebb1153ac54ddbbd3d3f0481a193f4bf0ead53b.tar.xz linux-aebb1153ac54ddbbd3d3f0481a193f4bf0ead53b.zip |
Merge branch 'master' into upstream
Diffstat (limited to 'drivers/i2c/chips/eeprom.c')
-rw-r--r-- | drivers/i2c/chips/eeprom.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c index 13c108269a6d..cec3a0c3894d 100644 --- a/drivers/i2c/chips/eeprom.c +++ b/drivers/i2c/chips/eeprom.c @@ -209,10 +209,14 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) } /* create the sysfs eeprom file */ - sysfs_create_bin_file(&new_client->dev.kobj, &eeprom_attr); + err = sysfs_create_bin_file(&new_client->dev.kobj, &eeprom_attr); + if (err) + goto exit_detach; return 0; +exit_detach: + i2c_detach_client(new_client); exit_kfree: kfree(data); exit: @@ -223,6 +227,8 @@ static int eeprom_detach_client(struct i2c_client *client) { int err; + sysfs_remove_bin_file(&client->dev.kobj, &eeprom_attr); + err = i2c_detach_client(client); if (err) return err; |