From: Wolfram Sang Date: Tue, 7 Jan 2020 17:47:35 +0000 (+0100) Subject: i2c: cht-wc: convert to use i2c_new_client_device() X-Git-Tag: v5.6-rc1~31^2~59 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6b5794abdcddfd3d1584aff1a13f440d5999ac84;p=users%2Fdwmw2%2Flinux.git i2c: cht-wc: 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 Tested-by: Hans de Goede Reviewed-by: Hans de Goede Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-cht-wc.c b/drivers/i2c/busses/i2c-cht-wc.c index b8fde61bb5d82..35e55feda763e 100644 --- a/drivers/i2c/busses/i2c-cht-wc.c +++ b/drivers/i2c/busses/i2c-cht-wc.c @@ -388,9 +388,9 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev) */ if (acpi_dev_present("INT33FE", NULL, -1)) { board_info.irq = adap->client_irq; - adap->client = i2c_new_device(&adap->adapter, &board_info); - if (!adap->client) { - ret = -ENOMEM; + adap->client = i2c_new_client_device(&adap->adapter, &board_info); + if (IS_ERR(adap->client)) { + ret = PTR_ERR(adap->client); goto del_adapter; } }