Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96391
b: refs/heads/master
c: 60b129d
h: refs/heads/master
i:
  96389: 3361cac
  96387: eb99ff5
  96383: 1fe4752
v: v3
  • Loading branch information
Jean Delvare authored and Jean Delvare committed May 11, 2008
1 parent 530fe6a commit 50fe666
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 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: b11a9d8392a698f01337232aa8c5d5603519943f
refs/heads/master: 60b129d7bfa3e20450816983bd52c49bb0bc1c21
14 changes: 8 additions & 6 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,11 @@ void i2c_unregister_device(struct i2c_client *client)
EXPORT_SYMBOL_GPL(i2c_unregister_device);


static const struct i2c_device_id dummy_id[] = {
{ "dummy", 0 },
{ },
};

static int dummy_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
Expand All @@ -342,13 +347,13 @@ static struct i2c_driver dummy_driver = {
.driver.name = "dummy",
.probe = dummy_probe,
.remove = dummy_remove,
.id_table = dummy_id,
};

/**
* i2c_new_dummy - return a new i2c device bound to a dummy driver
* @adapter: the adapter managing the device
* @address: seven bit address to be used
* @type: optional label used for i2c_client.name
* Context: can sleep
*
* This returns an I2C client bound to the "dummy" driver, intended for use
Expand All @@ -364,15 +369,12 @@ static struct i2c_driver dummy_driver = {
* i2c_unregister_device(); or NULL to indicate an error.
*/
struct i2c_client *
i2c_new_dummy(struct i2c_adapter *adapter, u16 address, const char *type)
i2c_new_dummy(struct i2c_adapter *adapter, u16 address)
{
struct i2c_board_info info = {
.driver_name = "dummy",
.addr = address,
I2C_BOARD_INFO("dummy", address),
};

if (type)
strlcpy(info.type, type, sizeof info.type);
return i2c_new_device(adapter, &info);
}
EXPORT_SYMBOL_GPL(i2c_new_dummy);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/rtc/rtc-s35390a.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static int s35390a_probe(struct i2c_client *client,
/* This chip uses multiple addresses, use dummy devices for them */
for (i = 1; i < 8; ++i) {
s35390a->client[i] = i2c_new_dummy(client->adapter,
client->addr + i, "rtc-s35390a");
client->addr + i);
if (!s35390a->client[i]) {
dev_err(&client->dev, "Address %02x unavailable\n",
client->addr + i);
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ i2c_new_probed_device(struct i2c_adapter *adap,
* client handles for the extra addresses.
*/
extern struct i2c_client *
i2c_new_dummy(struct i2c_adapter *adap, u16 address, const char *type);
i2c_new_dummy(struct i2c_adapter *adap, u16 address);

extern void i2c_unregister_device(struct i2c_client *);

Expand Down

0 comments on commit 50fe666

Please sign in to comment.