aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2006-01-06 06:42:03 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-13 14:26:11 -0500
commit348290a4ae143a692124330942b464ccdb0d0365 (patch)
tree1fae9909d4d4519c9548b5940be2dca7e31935c2 /drivers/media/video
parentd78967fb035aeb839a047ae69ce5f1ff39288a8d (diff)
[PATCH] Add bttv sub bus_type probe and remove methods
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/bttv-gpio.c24
-rw-r--r--drivers/media/video/bttv.h2
2 files changed, 24 insertions, 2 deletions
diff --git a/drivers/media/video/bttv-gpio.c b/drivers/media/video/bttv-gpio.c
index d64accc17b0e..c4d5e2b70c28 100644
--- a/drivers/media/video/bttv-gpio.c
+++ b/drivers/media/video/bttv-gpio.c
@@ -47,9 +47,29 @@ static int bttv_sub_bus_match(struct device *dev, struct device_driver *drv)
47 return 0; 47 return 0;
48} 48}
49 49
50static int bttv_sub_probe(struct device *dev)
51{
52 struct bttv_sub_device *sdev = to_bttv_sub_dev(dev);
53 struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver);
54
55 return sub->probe ? sub->probe(sdev) : -ENODEV;
56}
57
58static int bttv_sub_remove(struct device *dev)
59{
60 struct bttv_sub_device *sdev = to_bttv_sub_dev(dev);
61 struct bttv_sub_driver *sub = to_bttv_sub_drv(dev->driver);
62
63 if (sub->remove)
64 sub->remove(sdev);
65 return 0;
66}
67
50struct bus_type bttv_sub_bus_type = { 68struct bus_type bttv_sub_bus_type = {
51 .name = "bttv-sub", 69 .name = "bttv-sub",
52 .match = &bttv_sub_bus_match, 70 .match = &bttv_sub_bus_match,
71 .probe = bttv_sub_probe,
72 .remove = bttv_sub_remove,
53}; 73};
54EXPORT_SYMBOL(bttv_sub_bus_type); 74EXPORT_SYMBOL(bttv_sub_bus_type);
55 75
diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h
index e370d74f2a1b..9908c8e0c951 100644
--- a/drivers/media/video/bttv.h
+++ b/drivers/media/video/bttv.h
@@ -365,6 +365,8 @@ struct bttv_sub_device {
365struct bttv_sub_driver { 365struct bttv_sub_driver {
366 struct device_driver drv; 366 struct device_driver drv;
367 char wanted[BUS_ID_SIZE]; 367 char wanted[BUS_ID_SIZE];
368 int (*probe)(struct bttv_sub_device *sub);
369 void (*remove)(struct bttv_sub_device *sub);
368 void (*gpio_irq)(struct bttv_sub_device *sub); 370 void (*gpio_irq)(struct bttv_sub_device *sub);
369}; 371};
370#define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv) 372#define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)