Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: nvidia-gpu: 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: Wolfram Sang <wsa@the-dreams.de>

authored by

Wolfram Sang and committed by
Wolfram Sang
7fd0379f 41d06630

+3 -3
+3 -3
drivers/i2c/busses/i2c-nvidia-gpu.c
··· 280 280 i2cd->gpu_ccgx_ucsi->addr = 0x8; 281 281 i2cd->gpu_ccgx_ucsi->irq = irq; 282 282 i2cd->gpu_ccgx_ucsi->properties = ccgx_props; 283 - i2cd->ccgx_client = i2c_new_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi); 284 - if (!i2cd->ccgx_client) 285 - return -ENODEV; 283 + i2cd->ccgx_client = i2c_new_client_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi); 284 + if (IS_ERR(i2cd->ccgx_client)) 285 + return PTR_ERR(i2cd->ccgx_client); 286 286 287 287 return 0; 288 288 }