Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166772
b: refs/heads/master
c: 18c4078
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Oct 1, 2009
1 parent 2d0868e commit 5ef6e52
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5da5b6f9e967e8c62486444f97e66252c3768d7d
refs/heads/master: 18c4078489fe064cc0ed08be3381cf2f26657f5f
9 changes: 9 additions & 0 deletions trunk/sound/aoa/codecs/tas.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,15 @@ static int tas_create(struct i2c_adapter *adapter,
client = i2c_new_device(adapter, &info);
if (!client)
return -ENODEV;
/*
* We know the driver is already loaded, so the device should be
* already bound. If not it means binding failed, and then there
* is no point in keeping the device instantiated.
*/
if (!client->driver) {
i2c_unregister_device(client);
return -ENODEV;
}

/*
* Let i2c-core delete that device on driver removal.
Expand Down
12 changes: 12 additions & 0 deletions trunk/sound/ppc/keywest.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
strlcpy(info.type, "keywest", I2C_NAME_SIZE);
info.addr = keywest_ctx->addr;
keywest_ctx->client = i2c_new_device(adapter, &info);
if (!keywest_ctx->client)
return -ENODEV;
/*
* We know the driver is already loaded, so the device should be
* already bound. If not it means binding failed, and then there
* is no point in keeping the device instantiated.
*/
if (!keywest_ctx->client->driver) {
i2c_unregister_device(keywest_ctx->client);
keywest_ctx->client = NULL;
return -ENODEV;
}

/*
* Let i2c-core delete that device on driver removal.
Expand Down

0 comments on commit 5ef6e52

Please sign in to comment.