diff options
author | Russell King <rmk@arm.linux.org.uk> | 2006-01-06 11:42:03 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-13 11:26:11 -0800 |
commit | 348290a4ae143a692124330942b464ccdb0d0365 (patch) | |
tree | 1fae9909d4d4519c9548b5940be2dca7e31935c2 /drivers/media/video | |
parent | d78967fb035aeb839a047ae69ce5f1ff39288a8d (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.c | 24 | ||||
-rw-r--r-- | drivers/media/video/bttv.h | 2 |
2 files changed, 24 insertions, 2 deletions
diff --git a/drivers/media/video/bttv-gpio.c b/drivers/media/video/bttv-gpio.c index d64accc17b0..c4d5e2b70c2 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) return 0; } +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; +} + struct bus_type bttv_sub_bus_type = { - .name = "bttv-sub", - .match = &bttv_sub_bus_match, + .name = "bttv-sub", + .match = &bttv_sub_bus_match, + .probe = bttv_sub_probe, + .remove = bttv_sub_remove, }; EXPORT_SYMBOL(bttv_sub_bus_type); diff --git a/drivers/media/video/bttv.h b/drivers/media/video/bttv.h index e370d74f2a1..9908c8e0c95 100644 --- a/drivers/media/video/bttv.h +++ b/drivers/media/video/bttv.h @@ -365,6 +365,8 @@ struct bttv_sub_device { struct bttv_sub_driver { struct device_driver drv; char wanted[BUS_ID_SIZE]; + int (*probe)(struct bttv_sub_device *sub); + void (*remove)(struct bttv_sub_device *sub); void (*gpio_irq)(struct bttv_sub_device *sub); }; #define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv) |