From 8bd7bc82dd39ba77dd88c4dc39800dbe1a3346b6 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 15 Jan 2006 23:19:19 +0000 Subject: From: Russell King 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'linux/drivers/media/dvb/bt8xx') diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c index ad1ef4ca0..0183dc607 100644 --- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c @@ -780,9 +780,15 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) return 0; } +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) static int dvb_bt8xx_probe(struct device *dev) +#else +static int dvb_bt8xx_probe(struct bttv_sub_device *sub) +#endif { +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) struct bttv_sub_device *sub = to_bttv_sub_dev(dev); +#endif struct dvb_bt8xx_card *card; struct pci_dev* bttv_pci_dev; int ret; @@ -891,13 +897,25 @@ static int dvb_bt8xx_probe(struct device *dev) return ret; } +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) dev_set_drvdata(dev, card); +#else + dev_set_drvdata(&sub->dev, card); +#endif return 0; } +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) static int dvb_bt8xx_remove(struct device *dev) +#else +static int dvb_bt8xx_remove(struct bttv_sub_device *sub) +#endif { +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) struct dvb_bt8xx_card *card = dev_get_drvdata(dev); +#else + struct dvb_bt8xx_card *card = dev_get_drvdata(&sub->dev); +#endif dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr); @@ -920,6 +938,7 @@ static int dvb_bt8xx_remove(struct device *dev) static struct bttv_sub_driver driver = { .drv = { .name = "dvb-bt8xx", +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15) .probe = dvb_bt8xx_probe, .remove = dvb_bt8xx_remove, /* FIXME: @@ -927,7 +946,17 @@ static struct bttv_sub_driver driver = { * .suspend = dvb_bt8xx_suspend, * .resume = dvb_bt8xx_resume, */ +#endif }, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) + .probe = dvb_bt8xx_probe, + .remove = dvb_bt8xx_remove, + /* FIXME: + * .shutdown = dvb_bt8xx_shutdown, + * .suspend = dvb_bt8xx_suspend, + * .resume = dvb_bt8xx_resume, + */ +#endif }; static int __init dvb_bt8xx_init(void) -- cgit v1.2.3