summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/bttv-gpio.c29
-rw-r--r--linux/drivers/media/video/bttv.h6
2 files changed, 33 insertions, 2 deletions
diff --git a/linux/drivers/media/video/bttv-gpio.c b/linux/drivers/media/video/bttv-gpio.c
index f2ec2e787..8682662b3 100644
--- a/linux/drivers/media/video/bttv-gpio.c
+++ b/linux/drivers/media/video/bttv-gpio.c
@@ -1,5 +1,5 @@
/*
- $Id: bttv-gpio.c,v 1.11 2006/01/11 19:28:02 mchehab Exp $
+ $Id: bttv-gpio.c,v 1.12 2006/01/15 23:19:19 mchehab Exp $
bttv-gpio.c -- gpio sub drivers
@@ -48,9 +48,36 @@ static int bttv_sub_bus_match(struct device *dev, struct device_driver *drv)
return 0;
}
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+static int bttv_sub_probe(struct device *dev)
+{
+ struct bttv_sub_device *sdev = to_bttv_sub_dev(dev);
+ struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver);
+
+ return sub->probe ? sub->probe(sdev) : -ENODEV;
+}
+
+static int bttv_sub_remove(struct device *dev)
+{
+ struct bttv_sub_device *sdev = to_bttv_sub_dev(dev);
+ struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver);
+
+ if (sub->remove)
+ sub->remove(sdev);
+ return 0;
+}
+
+#endif
struct bus_type bttv_sub_bus_type = {
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
.name = "bttv-sub",
.match = &bttv_sub_bus_match,
+#else
+ .name = "bttv-sub",
+ .match = &bttv_sub_bus_match,
+ .probe = bttv_sub_probe,
+ .remove = bttv_sub_remove,
+#endif
};
EXPORT_SYMBOL(bttv_sub_bus_type);
diff --git a/linux/drivers/media/video/bttv.h b/linux/drivers/media/video/bttv.h
index 39d79e10e..bdc3a19e3 100644
--- a/linux/drivers/media/video/bttv.h
+++ b/linux/drivers/media/video/bttv.h
@@ -1,5 +1,5 @@
/*
- * $Id: bttv.h,v 1.37 2006/01/10 04:29:23 mkrufky Exp $
+ * $Id: bttv.h,v 1.38 2006/01/15 23:19:19 mchehab Exp $
*
* bttv - Bt848 frame grabber driver
*
@@ -374,6 +374,10 @@ struct bttv_sub_device {
struct bttv_sub_driver {
struct device_driver drv;
char wanted[BUS_ID_SIZE];
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
+ int (*probe)(struct bttv_sub_device *sub);
+ void (*remove)(struct bttv_sub_device *sub);
+#endif
void (*gpio_irq)(struct bttv_sub_device *sub);
};
#define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)