Commit d1fe2e78 authored by Wolfram Sang's avatar Wolfram Sang Committed by Sam Ravnborg

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200326211005.13301-4-wsa+renesas@sang-engineering.com
parent fae6802d
...@@ -393,7 +393,7 @@ sil164_detect_slave(struct i2c_client *client) ...@@ -393,7 +393,7 @@ sil164_detect_slave(struct i2c_client *client)
return NULL; return NULL;
} }
return i2c_new_device(adap, &info); return i2c_new_client_device(adap, &info);
} }
static int static int
...@@ -402,6 +402,7 @@ sil164_encoder_init(struct i2c_client *client, ...@@ -402,6 +402,7 @@ sil164_encoder_init(struct i2c_client *client,
struct drm_encoder_slave *encoder) struct drm_encoder_slave *encoder)
{ {
struct sil164_priv *priv; struct sil164_priv *priv;
struct i2c_client *slave_client;
priv = kzalloc(sizeof(*priv), GFP_KERNEL); priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -410,7 +411,9 @@ sil164_encoder_init(struct i2c_client *client, ...@@ -410,7 +411,9 @@ sil164_encoder_init(struct i2c_client *client,
encoder->slave_priv = priv; encoder->slave_priv = priv;
encoder->slave_funcs = &sil164_encoder_funcs; 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; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment