From 348290a4ae143a692124330942b464ccdb0d0365 Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 6 Jan 2006 11:42:03 +0000 Subject: [PATCH] Add bttv sub bus_type probe and remove methods Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman --- drivers/media/dvb/bt8xx/dvb-bt8xx.c | 23 +++++++++++------------ drivers/media/video/bttv-gpio.c | 24 ++++++++++++++++++++++-- drivers/media/video/bttv.h | 2 ++ 3 files changed, 35 insertions(+), 14 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index f65f64b00ff..44fcbe77c8f 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) return 0; } -static int dvb_bt8xx_probe(struct device *dev) +static int dvb_bt8xx_probe(struct bttv_sub_device *sub) { - struct bttv_sub_device *sub = to_bttv_sub_dev(dev); struct dvb_bt8xx_card *card; struct pci_dev* bttv_pci_dev; int ret; @@ -890,13 +889,13 @@ static int dvb_bt8xx_probe(struct device *dev) return ret; } - dev_set_drvdata(dev, card); + dev_set_drvdata(&sub->dev, card); return 0; } -static int dvb_bt8xx_remove(struct device *dev) +static int dvb_bt8xx_remove(struct bttv_sub_device *sub) { - struct dvb_bt8xx_card *card = dev_get_drvdata(dev); + struct dvb_bt8xx_card *card = dev_get_drvdata(&sub->dev); dprintk("dvb_bt8xx: unloading card%d\n", card->bttv_nr); @@ -919,14 +918,14 @@ static int dvb_bt8xx_remove(struct device *dev) static struct bttv_sub_driver driver = { .drv = { .name = "dvb-bt8xx", - .probe = dvb_bt8xx_probe, - .remove = dvb_bt8xx_remove, - /* FIXME: - * .shutdown = dvb_bt8xx_shutdown, - * .suspend = dvb_bt8xx_suspend, - * .resume = dvb_bt8xx_resume, - */ }, + .probe = dvb_bt8xx_probe, + .remove = dvb_bt8xx_remove, + /* FIXME: + * .shutdown = dvb_bt8xx_shutdown, + * .suspend = dvb_bt8xx_suspend, + * .resume = dvb_bt8xx_resume, + */ }; static int __init dvb_bt8xx_init(void) 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) -- cgit v1.2.3 From 858119e159384308a5dde67776691a2ebf70df0f Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Sat, 14 Jan 2006 13:20:43 -0800 Subject: [PATCH] Unlinline a bunch of other functions Remove the "inline" keyword from a bunch of big functions in the kernel with the goal of shrinking it by 30kb to 40kb Signed-off-by: Arjan van de Ven Signed-off-by: Ingo Molnar Acked-by: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/video/tvp5150.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index e86b522938f..9094fa9f2ec 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -93,7 +93,7 @@ struct tvp5150 { int sat; }; -static inline int tvp5150_read(struct i2c_client *c, unsigned char addr) +static int tvp5150_read(struct i2c_client *c, unsigned char addr) { unsigned char buffer[1]; int rc; -- cgit v1.2.3 From 69ff56c166629224e9fe914b8543021dc2f001f0 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 15 Jan 2006 13:13:13 +0100 Subject: [PATCH] Fix zoran_card compilation warning Fix the following warning which was introduced in 2.6.15-git8 by commit 7408187d223f63d46a13b6a35b8f96b032c2f623: CC [M] drivers/media/video/zoran_card.o drivers/media/video/zoran_card.c: In function `zr36057_init': drivers/media/video/zoran_card.c:1053: warning: assignment makes integer from pointer without a cast Signed-off-by: Jean Delvare Acked-by: Ronald S. Bultje Signed-off-by: Linus Torvalds --- drivers/media/video/zoran_card.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c index ea3288661a3..246e67cd8b5 100644 --- a/drivers/media/video/zoran_card.c +++ b/drivers/media/video/zoran_card.c @@ -995,7 +995,7 @@ test_interrupts (struct zoran *zr) static int __devinit zr36057_init (struct zoran *zr) { - unsigned long mem; + u32 *mem; void *vdev; unsigned mem_needed; int j; @@ -1058,10 +1058,10 @@ zr36057_init (struct zoran *zr) "%s: zr36057_init() - kmalloc (STAT_COM) failed\n", ZR_DEVNAME(zr)); kfree(vdev); - kfree((void *)mem); + kfree(mem); return -ENOMEM; } - zr->stat_com = (u32 *) mem; + zr->stat_com = mem; for (j = 0; j < BUZ_NUM_STAT_COM; j++) { zr->stat_com[j] = 1; /* mark as unavailable to zr36057 */ } -- cgit v1.2.3