aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/hdpvr
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/usb/hdpvr')
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-core.c6
-rw-r--r--drivers/media/usb/hdpvr/hdpvr-i2c.c5
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/usb/hdpvr/hdpvr-core.c b/drivers/media/usb/hdpvr/hdpvr-core.c
index 84dc26fe80ee..5c6193536399 100644
--- a/drivers/media/usb/hdpvr/hdpvr-core.c
+++ b/drivers/media/usb/hdpvr/hdpvr-core.c
@@ -391,7 +391,7 @@ static int hdpvr_probe(struct usb_interface *interface,
391 goto error; 391 goto error;
392 } 392 }
393 393
394#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 394#if IS_ENABLED(CONFIG_I2C)
395 retval = hdpvr_register_i2c_adapter(dev); 395 retval = hdpvr_register_i2c_adapter(dev);
396 if (retval < 0) { 396 if (retval < 0) {
397 v4l2_err(&dev->v4l2_dev, "i2c adapter register failed\n"); 397 v4l2_err(&dev->v4l2_dev, "i2c adapter register failed\n");
@@ -419,7 +419,7 @@ static int hdpvr_probe(struct usb_interface *interface,
419 return 0; 419 return 0;
420 420
421reg_fail: 421reg_fail:
422#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 422#if IS_ENABLED(CONFIG_I2C)
423 i2c_del_adapter(&dev->i2c_adapter); 423 i2c_del_adapter(&dev->i2c_adapter);
424#endif 424#endif
425error: 425error:
@@ -451,7 +451,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
451 mutex_lock(&dev->io_mutex); 451 mutex_lock(&dev->io_mutex);
452 hdpvr_cancel_queue(dev); 452 hdpvr_cancel_queue(dev);
453 mutex_unlock(&dev->io_mutex); 453 mutex_unlock(&dev->io_mutex);
454#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 454#if IS_ENABLED(CONFIG_I2C)
455 i2c_del_adapter(&dev->i2c_adapter); 455 i2c_del_adapter(&dev->i2c_adapter);
456#endif 456#endif
457 video_unregister_device(dev->video_dev); 457 video_unregister_device(dev->video_dev);
diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c
index 031cf024304c..a38f58c4c6bf 100644
--- a/drivers/media/usb/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c
@@ -13,7 +13,7 @@
13 * 13 *
14 */ 14 */
15 15
16#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) 16#if IS_ENABLED(CONFIG_I2C)
17 17
18#include <linux/i2c.h> 18#include <linux/i2c.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
@@ -217,8 +217,7 @@ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
217 217
218 hdpvr_activate_ir(dev); 218 hdpvr_activate_ir(dev);
219 219
220 memcpy(&dev->i2c_adapter, &hdpvr_i2c_adapter_template, 220 dev->i2c_adapter = hdpvr_i2c_adapter_template;
221 sizeof(struct i2c_adapter));
222 dev->i2c_adapter.dev.parent = &dev->udev->dev; 221 dev->i2c_adapter.dev.parent = &dev->udev->dev;
223 222
224 i2c_set_adapdata(&dev->i2c_adapter, dev); 223 i2c_set_adapdata(&dev->i2c_adapter, dev);