From: minyard@acm.org
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
openipmi-developer@lists.sourceforge.net,
linux-kernel@vger.kernel.org, Corey Minyard <cminyard@mvista.com>
Subject: [PATCH] char: ipmi: convert to use i2c_new_client_device()
Date: Tue, 12 May 2020 16:45:32 -0500 [thread overview]
Message-ID: <20200512214532.14117-1-minyard@acm.org> (raw)
In-Reply-To: <20200326210958.13051-2-wsa+renesas@sang-engineering.com>
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Move away from the deprecated API.
Based on a patch by Wolfram Sang <wsa+renesas@sang-engineering.com>.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
I think this works.
drivers/char/ipmi/ipmi_ssif.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index b7145f370d3b..65563e5e5731 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -1943,12 +1943,14 @@ static int ssif_probe(struct i2c_client *client, const struct i2c_device_id *id)
static int ssif_adapter_handler(struct device *adev, void *opaque)
{
struct ssif_addr_info *addr_info = opaque;
+ struct i2c_client *cl;
if (adev->type != &i2c_adapter_type)
return 0;
- addr_info->added_client = i2c_new_device(to_i2c_adapter(adev),
- &addr_info->binfo);
+ cl = i2c_new_client_device(to_i2c_adapter(adev), &addr_info->binfo);
+ if (!IS_ERR(cl))
+ addr_info->added_client = cl;
if (!addr_info->adapter_name)
return 1; /* Only try the first I2C adapter by default. */
--
2.17.1
next prev parent reply other threads:[~2020-05-12 21:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-26 21:09 [PATCH 0/1] char: convert to use new I2C API Wolfram Sang
2020-03-26 21:09 ` [PATCH 1/1] char: ipmi: convert to use i2c_new_client_device() Wolfram Sang
2020-05-12 16:30 ` Wolfram Sang
2020-05-12 18:25 ` Corey Minyard
2020-05-12 20:07 ` Wolfram Sang
2020-05-12 21:14 ` Corey Minyard
2020-05-13 7:10 ` Wolfram Sang
2020-05-13 12:28 ` Corey Minyard
2020-05-12 21:45 ` minyard [this message]
2020-05-13 8:37 ` [PATCH] " Wolfram Sang
2020-05-13 11:18 ` Corey Minyard
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=20200512214532.14117-1-minyard@acm.org \
--to=minyard@acm.org \
--cc=arnd@arndb.de \
--cc=cminyard@mvista.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=wsa+renesas@sang-engineering.com \
/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).