mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-10 07:50:04 +00:00
mfd: htc-i2cpld: 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> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
e8a6f4acae
commit
8bc401f3f5
@ -355,12 +355,12 @@ static int htcpld_register_chip_i2c(
|
|||||||
info.platform_data = chip;
|
info.platform_data = chip;
|
||||||
|
|
||||||
/* Add the I2C device. This calls the probe() function. */
|
/* Add the I2C device. This calls the probe() function. */
|
||||||
client = i2c_new_device(adapter, &info);
|
client = i2c_new_client_device(adapter, &info);
|
||||||
if (!client) {
|
if (IS_ERR(client)) {
|
||||||
/* I2C device registration failed, contineu with the next */
|
/* I2C device registration failed, contineu with the next */
|
||||||
dev_warn(dev, "Unable to add I2C device for 0x%x\n",
|
dev_warn(dev, "Unable to add I2C device for 0x%x\n",
|
||||||
plat_chip_data->addr);
|
plat_chip_data->addr);
|
||||||
return -ENODEV;
|
return PTR_ERR(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_set_clientdata(client, chip);
|
i2c_set_clientdata(client, chip);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user