diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2006-01-15 23:19:19 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2006-01-15 23:19:19 +0000 |
commit | 8bd7bc82dd39ba77dd88c4dc39800dbe1a3346b6 (patch) | |
tree | 0262c82d88cf3885f0d0b6efab5e069cc2058f26 /linux/drivers/media/video | |
parent | a1a9178a0f1df6e336d6548ee508e772bde91119 (diff) | |
download | mediapointer-dvb-s2-8bd7bc82dd39ba77dd88c4dc39800dbe1a3346b6.tar.gz mediapointer-dvb-s2-8bd7bc82dd39ba77dd88c4dc39800dbe1a3346b6.tar.bz2 |
From: Russell King <rmk@arm.linux.org.uk>
Add bttv sub bus_type probe and remove methods
Add bttv sub bus_type probe and remove methods
kernel-sync
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/bttv-gpio.c | 29 | ||||
-rw-r--r-- | linux/drivers/media/video/bttv.h | 6 |
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) |