From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-i2c@vger.kernel.org
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/6] media: usb: cx231xx: convert to use i2c_new_client_device()
Date: Thu, 26 Mar 2020 22:09:44 +0100 [thread overview]
Message-ID: <20200326210947.12747-5-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20200326210947.12747-1-wsa+renesas@sang-engineering.com>
Move away from the deprecated API and make use of the fact that
unregistering devices is NULL- and ERR_PTR-safe.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/media/usb/cx231xx/cx231xx-input.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/usb/cx231xx/cx231xx-input.c b/drivers/media/usb/cx231xx/cx231xx-input.c
index 9f88c640ec2b..8149702bcf89 100644
--- a/drivers/media/usb/cx231xx/cx231xx-input.c
+++ b/drivers/media/usb/cx231xx/cx231xx-input.c
@@ -88,7 +88,7 @@ int cx231xx_ir_init(struct cx231xx *dev)
ir_i2c_bus = cx231xx_boards[dev->model].ir_i2c_master;
dev_dbg(dev->dev, "Trying to bind ir at bus %d, addr 0x%02x\n",
ir_i2c_bus, info.addr);
- dev->ir_i2c_client = i2c_new_device(
+ dev->ir_i2c_client = i2c_new_client_device(
cx231xx_get_i2c_adap(dev, ir_i2c_bus), &info);
return 0;
@@ -96,7 +96,6 @@ int cx231xx_ir_init(struct cx231xx *dev)
void cx231xx_ir_exit(struct cx231xx *dev)
{
- if (dev->ir_i2c_client)
- i2c_unregister_device(dev->ir_i2c_client);
+ i2c_unregister_device(dev->ir_i2c_client);
dev->ir_i2c_client = NULL;
}
--
2.20.1
next prev parent reply other threads:[~2020-03-26 21:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-26 21:09 [PATCH 0/6] media: convert to use new I2C API Wolfram Sang
2020-03-26 21:09 ` [PATCH 1/6] media: pci: cx88: convert to use i2c_new_client_device() Wolfram Sang
2020-03-26 21:09 ` [PATCH 2/6] media: pci: saa7134: " Wolfram Sang
2020-03-26 21:09 ` [PATCH 3/6] media: marvell-ccic: " Wolfram Sang
2020-03-26 21:09 ` Wolfram Sang [this message]
2020-03-26 21:09 ` [PATCH 5/6] media: usb: hdpvr: " Wolfram Sang
2020-03-26 21:09 ` [PATCH 6/6] media: usb: pvrusb2: " Wolfram Sang
2020-03-29 3:14 ` Mike Isely
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=20200326210947.12747-5-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@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).