From 286e78a9b508728604b40f39e0051d00f894a807 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 26 Mar 2020 22:09:41 +0100 Subject: [PATCH] media: pci: cx88: convert to use i2c_new_client_device() 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/cx88/cx88-core.c | 3 +-- drivers/media/pci/cx88/cx88-input.c | 2 +- drivers/media/pci/cx88/cx88-video.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c index dcadf78..48c8a34 100644 --- a/drivers/media/pci/cx88/cx88-core.c +++ b/drivers/media/pci/cx88/cx88-core.c @@ -1070,8 +1070,7 @@ void cx88_core_put(struct cx88_core *core, struct pci_dev *pci) mutex_lock(&devlist); cx88_ir_fini(core); if (core->i2c_rc == 0) { - if (core->i2c_rtc) - i2c_unregister_device(core->i2c_rtc); + i2c_unregister_device(core->i2c_rtc); i2c_del_adapter(&core->i2c_adap); } list_del(&core->devlist); diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c index c7c2acd..7e0fed9 100644 --- a/drivers/media/pci/cx88/cx88-input.c +++ b/drivers/media/pci/cx88/cx88-input.c @@ -638,7 +638,7 @@ void cx88_i2c_init_ir(struct cx88_core *core) I2C_SMBUS_READ, 0, I2C_SMBUS_QUICK, NULL) >= 0) { info.addr = *addrp; - i2c_new_device(&core->i2c_adap, &info); + i2c_new_client_device(&core->i2c_adap, &info); break; } } diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 6aabc45..ba0e966 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c @@ -1385,7 +1385,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev, }; request_module("rtc-isl1208"); - core->i2c_rtc = i2c_new_device(&core->i2c_adap, &rtc_info); + core->i2c_rtc = i2c_new_client_device(&core->i2c_adap, &rtc_info); } /* fall-through */ case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO: -- 2.7.4