diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 23 | ||||
-rw-r--r-- | drivers/media/video/bttv-gpio.c | 24 | ||||
-rw-r--r-- | drivers/media/video/bttv.h | 2 | ||||
-rw-r--r-- | drivers/media/video/tvp5150.c | 2 | ||||
-rw-r--r-- | drivers/media/video/zoran_card.c | 6 |
5 files changed, 39 insertions, 18 deletions
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index f65f64b00ff3..44fcbe77c8f9 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -779,9 +779,8 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
779 | return 0; | 779 | return 0; |
780 | } | 780 | } |
781 | 781 | ||
782 | static int dvb_bt8xx_probe(struct device *dev) | 782 | static int dvb_bt8xx_probe(struct bttv_sub_device *sub) |
783 | { | 783 | { |
784 | struct bttv_sub_device *sub = to_bttv_sub_dev(dev); | ||
785 | struct dvb_bt8xx_card *card; | 784 | struct dvb_bt8xx_card *card; |
786 | struct pci_dev* bttv_pci_dev; | 785 | struct pci_dev* bttv_pci_dev; |
787 | int ret; | 786 | int ret; |
@@ -890,13 +889,13 @@ static int dvb_bt8xx_probe(struct device *dev) | |||
890 | return ret; | 889 | return ret; |
891 | } | 890 | } |
892 | 891 | ||
893 | dev_set_drvdata(dev, card); | 892 | dev_set_drvdata(&sub->dev, card); |
894 | return 0; | 893 | return 0; |
895 | } | 894 | } |
896 | 895 | ||
897 | static int dvb_bt8xx_remove(struct device *dev) | 896 | static int dvb_bt8xx_remove(struct bttv_sub_device *sub) |
898 | { | 897 | { |
899 | struct dvb_bt8xx_card *card = dev_get_drvdata(dev); | 898 | struct dvb_bt8xx_card *card = dev_get_drvdata(&sub->dev); |
900 | 899 | ||
901 | dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr); | 900 | dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr); |
902 | 901 | ||
@@ -919,14 +918,14 @@ static int dvb_bt8xx_remove(struct device *dev) | |||
919 | static struct bttv_sub_driver driver = { | 918 | static struct bttv_sub_driver driver = { |
920 | .drv = { | 919 | .drv = { |
921 | .name = "dvb-bt8xx", | 920 | .name = "dvb-bt8xx", |
922 | .probe = dvb_bt8xx_probe, | ||
923 | .remove = dvb_bt8xx_remove, | ||
924 | /* FIXME: | ||
925 | * .shutdown = dvb_bt8xx_shutdown, | ||
926 | * .suspend = dvb_bt8xx_suspend, | ||
927 | * .resume = dvb_bt8xx_resume, | ||
928 | */ | ||
929 | }, | 921 | }, |
922 | .probe = dvb_bt8xx_probe, | ||
923 | .remove = dvb_bt8xx_remove, | ||
924 | /* FIXME: | ||
925 | * .shutdown = dvb_bt8xx_shutdown, | ||
926 | * .suspend = dvb_bt8xx_suspend, | ||
927 | * .resume = dvb_bt8xx_resume, | ||
928 | */ | ||
930 | }; | 929 | }; |
931 | 930 | ||
932 | static int __init dvb_bt8xx_init(void) | 931 | static int __init dvb_bt8xx_init(void) |
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 | ||
50 | static 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 | |||
58 | static 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 | |||
50 | struct bus_type bttv_sub_bus_type = { | 68 | struct 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 | }; |
54 | EXPORT_SYMBOL(bttv_sub_bus_type); | 74 | EXPORT_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 { | |||
365 | struct bttv_sub_driver { | 365 | struct 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) |
diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 8713c4d0dcca..fad9ea0ae4f2 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c | |||
@@ -93,7 +93,7 @@ struct tvp5150 { | |||
93 | int sat; | 93 | int sat; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | static inline int tvp5150_read(struct i2c_client *c, unsigned char addr) | 96 | static int tvp5150_read(struct i2c_client *c, unsigned char addr) |
97 | { | 97 | { |
98 | unsigned char buffer[1]; | 98 | unsigned char buffer[1]; |
99 | int rc; | 99 | int rc; |
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c index ea3288661a34..246e67cd8b51 100644 --- a/drivers/media/video/zoran_card.c +++ b/drivers/media/video/zoran_card.c | |||
@@ -995,7 +995,7 @@ test_interrupts (struct zoran *zr) | |||
995 | static int __devinit | 995 | static int __devinit |
996 | zr36057_init (struct zoran *zr) | 996 | zr36057_init (struct zoran *zr) |
997 | { | 997 | { |
998 | unsigned long mem; | 998 | u32 *mem; |
999 | void *vdev; | 999 | void *vdev; |
1000 | unsigned mem_needed; | 1000 | unsigned mem_needed; |
1001 | int j; | 1001 | int j; |
@@ -1058,10 +1058,10 @@ zr36057_init (struct zoran *zr) | |||
1058 | "%s: zr36057_init() - kmalloc (STAT_COM) failed\n", | 1058 | "%s: zr36057_init() - kmalloc (STAT_COM) failed\n", |
1059 | ZR_DEVNAME(zr)); | 1059 | ZR_DEVNAME(zr)); |
1060 | kfree(vdev); | 1060 | kfree(vdev); |
1061 | kfree((void *)mem); | 1061 | kfree(mem); |
1062 | return -ENOMEM; | 1062 | return -ENOMEM; |
1063 | } | 1063 | } |
1064 | zr->stat_com = (u32 *) mem; | 1064 | zr->stat_com = mem; |
1065 | for (j = 0; j < BUZ_NUM_STAT_COM; j++) { | 1065 | for (j = 0; j < BUZ_NUM_STAT_COM; j++) { |
1066 | zr->stat_com[j] = 1; /* mark as unavailable to zr36057 */ | 1066 | zr->stat_com[j] = 1; /* mark as unavailable to zr36057 */ |
1067 | } | 1067 | } |