V4L/DVB (11152): hdpvr: Fix build with Config_I2C not set
authorJanne Grunau <j@jannau.net>
Mon, 23 Mar 2009 21:18:54 +0000 (18:18 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:43:32 +0000 (12:43 -0300)
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/hdpvr/Makefile
drivers/media/video/hdpvr/hdpvr-core.c

index 79ad2e16cb8f4b86168c856483a931321688ea66..e0230fcb2e360f234543c5a89612cc81d5831265 100644 (file)
@@ -1,4 +1,6 @@
-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
 
index 1c93589bf595e364bcee44c5ab5615f0b6ee09fa..e96aed42d19201353c147362489e5e1afb2978d3 100644 (file)
@@ -348,6 +348,14 @@ static int hdpvr_probe(struct usb_interface *interface,
                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 */
        usb_set_intfdata(interface, dev);
@@ -389,12 +397,14 @@ static void hdpvr_disconnect(struct usb_interface *interface)
        mutex_unlock(&dev->io_mutex);
 
        /* deregister I2C adapter */
+#ifdef CONFIG_I2C
        mutex_lock(&dev->i2c_mutex);
        if (dev->i2c_adapter)
                i2c_del_adapter(dev->i2c_adapter);
        kfree(dev->i2c_adapter);
        dev->i2c_adapter = NULL;
        mutex_unlock(&dev->i2c_mutex);
+#endif /* CONFIG_I2C */
 
        atomic_dec(&dev_nr);