Skip to content

Commit 04a9af2

Browse files
Wolfram Sangtiwai
authored andcommitted
ALSA: ppc: keywest: convert to use i2c_new_client_device()
Move away from the deprecated API and return the shiny new ERRPTR where useful. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 2ceb65c commit 04a9af2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sound/ppc/keywest.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ static int keywest_probe(struct i2c_client *client,
4040
static int keywest_attach_adapter(struct i2c_adapter *adapter)
4141
{
4242
struct i2c_board_info info;
43+
struct i2c_client *client;
4344

4445
if (! keywest_ctx)
4546
return -EINVAL;
@@ -50,9 +51,11 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
5051
memset(&info, 0, sizeof(struct i2c_board_info));
5152
strlcpy(info.type, "keywest", I2C_NAME_SIZE);
5253
info.addr = keywest_ctx->addr;
53-
keywest_ctx->client = i2c_new_device(adapter, &info);
54-
if (!keywest_ctx->client)
55-
return -ENODEV;
54+
client = i2c_new_client_device(adapter, &info);
55+
if (IS_ERR(client))
56+
return PTR_ERR(client);
57+
keywest_ctx->client = client;
58+
5659
/*
5760
* We know the driver is already loaded, so the device should be
5861
* already bound. If not it means binding failed, and then there

0 commit comments

Comments
 (0)