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

drm/i2c/sil164: 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>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200326211005.13301-4-wsa+renesas@sang-engineering.com

authored by

Wolfram Sang and committed by
Sam Ravnborg
d1fe2e78 fae6802d

+5 -2
+5 -2
drivers/gpu/drm/i2c/sil164_drv.c
··· 393 393 return NULL; 394 394 } 395 395 396 - return i2c_new_device(adap, &info); 396 + return i2c_new_client_device(adap, &info); 397 397 } 398 398 399 399 static int ··· 402 402 struct drm_encoder_slave *encoder) 403 403 { 404 404 struct sil164_priv *priv; 405 + struct i2c_client *slave_client; 405 406 406 407 priv = kzalloc(sizeof(*priv), GFP_KERNEL); 407 408 if (!priv) ··· 411 410 encoder->slave_priv = priv; 412 411 encoder->slave_funcs = &sil164_encoder_funcs; 413 412 414 - priv->duallink_slave = sil164_detect_slave(client); 413 + slave_client = sil164_detect_slave(client); 414 + if (!IS_ERR(slave_client)) 415 + priv->duallink_slave = slave_client; 415 416 416 417 return 0; 417 418 }