diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2020-03-26 22:10:01 +0100 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2020-03-28 22:48:03 +0100 |
commit | d1fe2e78f27f45aec626d104c2577be59f83ff4d (patch) | |
tree | 279e3b1bf9d51654f6bf256ddfa39e236a39d12e | |
parent | fae6802daf46fa4665fe964eb943f026bcf32fbf (diff) |
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
-rw-r--r-- | drivers/gpu/drm/i2c/sil164_drv.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i2c/sil164_drv.c b/drivers/gpu/drm/i2c/sil164_drv.c index a839f78a4c8a..741886b54419 100644 --- a/drivers/gpu/drm/i2c/sil164_drv.c +++ b/drivers/gpu/drm/i2c/sil164_drv.c @@ -393,7 +393,7 @@ sil164_detect_slave(struct i2c_client *client) return NULL; } - return i2c_new_device(adap, &info); + return i2c_new_client_device(adap, &info); } static int @@ -402,6 +402,7 @@ sil164_encoder_init(struct i2c_client *client, struct drm_encoder_slave *encoder) { struct sil164_priv *priv; + struct i2c_client *slave_client; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) @@ -410,7 +411,9 @@ sil164_encoder_init(struct i2c_client *client, encoder->slave_priv = priv; encoder->slave_funcs = &sil164_encoder_funcs; - priv->duallink_slave = sil164_detect_slave(client); + slave_client = sil164_detect_slave(client); + if (!IS_ERR(slave_client)) + priv->duallink_slave = slave_client; return 0; } |