Commit c457377a authored by Janne Grunau's avatar Janne Grunau Committed by Mauro Carvalho Chehab

V4L/DVB (11152): hdpvr: Fix build with Config_I2C not set

Signed-off-by: default avatarJanne Grunau <j@jannau.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 235d0ff2
hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-i2c.o hdpvr-video.o hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-video.o
hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o
obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o
......
...@@ -348,6 +348,14 @@ static int hdpvr_probe(struct usb_interface *interface, ...@@ -348,6 +348,14 @@ static int hdpvr_probe(struct usb_interface *interface,
goto error; goto error;
} }
#ifdef CONFIG_I2C
/* until i2c is working properly */
retval = 0; /* hdpvr_register_i2c_adapter(dev); */
if (retval < 0) {
err("registering i2c adapter failed");
goto error;
}
#endif /* CONFIG_I2C */
/* save our data pointer in this interface device */ /* save our data pointer in this interface device */
usb_set_intfdata(interface, dev); usb_set_intfdata(interface, dev);
...@@ -389,12 +397,14 @@ static void hdpvr_disconnect(struct usb_interface *interface) ...@@ -389,12 +397,14 @@ static void hdpvr_disconnect(struct usb_interface *interface)
mutex_unlock(&dev->io_mutex); mutex_unlock(&dev->io_mutex);
/* deregister I2C adapter */ /* deregister I2C adapter */
#ifdef CONFIG_I2C
mutex_lock(&dev->i2c_mutex); mutex_lock(&dev->i2c_mutex);
if (dev->i2c_adapter) if (dev->i2c_adapter)
i2c_del_adapter(dev->i2c_adapter); i2c_del_adapter(dev->i2c_adapter);
kfree(dev->i2c_adapter); kfree(dev->i2c_adapter);
dev->i2c_adapter = NULL; dev->i2c_adapter = NULL;
mutex_unlock(&dev->i2c_mutex); mutex_unlock(&dev->i2c_mutex);
#endif /* CONFIG_I2C */
atomic_dec(&dev_nr); atomic_dec(&dev_nr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment