ALSA: ppc: keywest: convert to use i2c_new_client_device()
[linux-block.git] / sound / ppc / keywest.c
index 093806d735c6181be54728bff32cdbbccb70322d..9554a0c506afbc60239453e8cfd5ea719e6ac695 100644 (file)
@@ -40,6 +40,7 @@ static int keywest_probe(struct i2c_client *client,
 static int keywest_attach_adapter(struct i2c_adapter *adapter)
 {
        struct i2c_board_info info;
+       struct i2c_client *client;
 
        if (! keywest_ctx)
                return -EINVAL;
@@ -50,9 +51,11 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
        memset(&info, 0, sizeof(struct i2c_board_info));
        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;
+       client = i2c_new_client_device(adapter, &info);
+       if (IS_ERR(client))
+               return PTR_ERR(client);
+       keywest_ctx->client = client;
+
        /*
         * We know the driver is already loaded, so the device should be
         * already bound. If not it means binding failed, and then there