Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215605
b: refs/heads/master
c: 51b54ba
h: refs/heads/master
i:
  215603: b2e34a4
v: v3
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Oct 24, 2010
1 parent bbf3fdc commit 51b0eb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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: d57558d0f3b41bb260aaa327150d49f1810461f5
refs/heads/master: 51b54ba9bb16b9fc28ec88006778d330af00bf8b
13 changes: 6 additions & 7 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,26 +1508,25 @@ static int i2c_detect(struct i2c_adapter *adapter, struct i2c_driver *driver)
if (!driver->detect || !address_list)
return 0;

/* Stop here if the classes do not match */
if (!(adapter->class & driver->class))
return 0;

/* Set up a temporary client to help detect callback */
temp_client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
if (!temp_client)
return -ENOMEM;
temp_client->adapter = adapter;

/* Stop here if the classes do not match */
if (!(adapter->class & driver->class))
goto exit_free;

for (i = 0; address_list[i] != I2C_CLIENT_END; i += 1) {
dev_dbg(&adapter->dev, "found normal entry for adapter %d, "
"addr 0x%02x\n", adap_id, address_list[i]);
temp_client->addr = address_list[i];
err = i2c_detect_address(temp_client, driver);
if (err)
goto exit_free;
if (unlikely(err))
break;
}

exit_free:
kfree(temp_client);
return err;
}
Expand Down

0 comments on commit 51b0eb2

Please sign in to comment.