From: Wolfram Sang Date: Thu, 26 Mar 2020 21:10:09 +0000 (+0100) Subject: mfd: htc-i2cpld: Convert to use i2c_new_client_device() X-Git-Tag: v5.15~3715^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8bc401f3f56e69a0bf854952a028fd2335ae5cdc;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Lee Jones --- diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c index 8ad6768..247f984 100644 --- a/drivers/mfd/htc-i2cpld.c +++ b/drivers/mfd/htc-i2cpld.c @@ -355,12 +355,12 @@ static int htcpld_register_chip_i2c( info.platform_data = chip; /* Add the I2C device. This calls the probe() function. */ - client = i2c_new_device(adapter, &info); - if (!client) { + client = i2c_new_client_device(adapter, &info); + if (IS_ERR(client)) { /* I2C device registration failed, contineu with the next */ dev_warn(dev, "Unable to add I2C device for 0x%x\n", plat_chip_data->addr); - return -ENODEV; + return PTR_ERR(client); } i2c_set_clientdata(client, chip);