From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org
Cc: David Airlie <airlied@linux.ie>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] drm/i2c/sil164: convert to use i2c_new_client_device()
Date: Thu, 26 Mar 2020 22:10:01 +0100 [thread overview]
Message-ID: <20200326211005.13301-4-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20200326211005.13301-1-wsa+renesas@sang-engineering.com>
Move away from the deprecated API and return the shiny new ERRPTR where
useful.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/gpu/drm/i2c/sil164_drv.c | 7 +++++--
1 file 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;
}
--
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-03-26 21:35 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-26 21:09 [PATCH 0/6] gpu: convert to use new I2C API Wolfram Sang
2020-03-26 21:09 ` [PATCH 1/6] drm/amdgpu: convert to use i2c_new_client_device() Wolfram Sang
2020-03-26 21:10 ` [PATCH 2/6] drm/gma500: " Wolfram Sang
2020-03-26 21:10 ` Wolfram Sang [this message]
2020-03-26 21:10 ` [PATCH 4/6] drm/i2c/tda998x: " Wolfram Sang
2020-03-26 21:10 ` [PATCH 5/6] drm/nouveau/therm: " Wolfram Sang
2020-03-26 21:10 ` [PATCH 6/6] drm/radeon: " Wolfram Sang
2020-03-27 14:25 ` Alex Deucher
2020-03-27 15:25 ` Sam Ravnborg
2020-03-27 15:27 ` Alex Deucher
2020-03-27 15:45 ` Wolfram Sang
2020-03-27 17:03 ` Sam Ravnborg
2020-03-28 21:49 ` [PATCH 0/6] gpu: convert to use new I2C API Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200326211005.13301-4-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).