mirror of https://github.com/torvalds/linux.git
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 <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20200326211013.13531-2-wsa+renesas@sang-engineering.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
2ceb65cd04
commit
04a9af2e03
|
|
@ -40,6 +40,7 @@ static int keywest_probe(struct i2c_client *client,
|
||||||
static int keywest_attach_adapter(struct i2c_adapter *adapter)
|
static int keywest_attach_adapter(struct i2c_adapter *adapter)
|
||||||
{
|
{
|
||||||
struct i2c_board_info info;
|
struct i2c_board_info info;
|
||||||
|
struct i2c_client *client;
|
||||||
|
|
||||||
if (! keywest_ctx)
|
if (! keywest_ctx)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
@ -50,9 +51,11 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
|
||||||
memset(&info, 0, sizeof(struct i2c_board_info));
|
memset(&info, 0, sizeof(struct i2c_board_info));
|
||||||
strlcpy(info.type, "keywest", I2C_NAME_SIZE);
|
strlcpy(info.type, "keywest", I2C_NAME_SIZE);
|
||||||
info.addr = keywest_ctx->addr;
|
info.addr = keywest_ctx->addr;
|
||||||
keywest_ctx->client = i2c_new_device(adapter, &info);
|
client = i2c_new_client_device(adapter, &info);
|
||||||
if (!keywest_ctx->client)
|
if (IS_ERR(client))
|
||||||
return -ENODEV;
|
return PTR_ERR(client);
|
||||||
|
keywest_ctx->client = client;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We know the driver is already loaded, so the device should be
|
* We know the driver is already loaded, so the device should be
|
||||||
* already bound. If not it means binding failed, and then there
|
* already bound. If not it means binding failed, and then there
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue