diff options
author | Gerd Knorr <devnull@localhost> | 2005-02-16 12:14:10 +0000 |
---|---|---|
committer | Gerd Knorr <devnull@localhost> | 2005-02-16 12:14:10 +0000 |
commit | 49d11227095eb70349cfc649d841e931b6c9e66d (patch) | |
tree | cd27ed5d131530a0803a42a250a72e260b4b4d4e /linux/drivers/media | |
parent | 2d9a38427d7844740c5a593fa5c42fe3317b95bc (diff) | |
download | mediapointer-dvb-s2-49d11227095eb70349cfc649d841e931b6c9e66d.tar.gz mediapointer-dvb-s2-49d11227095eb70349cfc649d841e931b6c9e66d.tar.bz2 |
- drop unused+obsolete i2c_info code.
- fix use-after-free bug in bttv-gpio.
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/bttv-gpio.c | 17 | ||||
-rw-r--r-- | linux/drivers/media/video/bttv-i2c.c | 19 | ||||
-rw-r--r-- | linux/drivers/media/video/bttv.h | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/bttvp.h | 3 |
4 files changed, 5 insertions, 38 deletions
diff --git a/linux/drivers/media/video/bttv-gpio.c b/linux/drivers/media/video/bttv-gpio.c index ef6744232..77320cdf2 100644 --- a/linux/drivers/media/video/bttv-gpio.c +++ b/linux/drivers/media/video/bttv-gpio.c @@ -1,5 +1,5 @@ /* - $Id: bttv-gpio.c,v 1.6 2004/11/03 09:04:50 kraxel Exp $ + $Id: bttv-gpio.c,v 1.7 2005/02/16 12:14:10 kraxel Exp $ bttv-gpio.c -- gpio sub drivers @@ -94,6 +94,7 @@ int bttv_sub_del_devices(struct bttv_core *core) list_for_each_safe(item,save,&core->subs) { sub = list_entry(item,struct bttv_sub_device,list); + list_del(&sub->list); device_unregister(&sub->dev); } return 0; @@ -113,20 +114,6 @@ void bttv_gpio_irq(struct bttv_core *core) } } -void bttv_i2c_info(struct bttv_core *core, struct i2c_client *client, int attach) -{ - struct bttv_sub_driver *drv; - struct bttv_sub_device *dev; - struct list_head *item; - - list_for_each(item,&core->subs) { - dev = list_entry(item,struct bttv_sub_device,list); - drv = to_bttv_sub_drv(dev->dev.driver); - if (drv && drv->i2c_info) - drv->i2c_info(dev,client,attach); - } -} - /* ----------------------------------------------------------------------- */ /* external: sub-driver register/unregister */ diff --git a/linux/drivers/media/video/bttv-i2c.c b/linux/drivers/media/video/bttv-i2c.c index 130f2a6de..c02cdb5fa 100644 --- a/linux/drivers/media/video/bttv-i2c.c +++ b/linux/drivers/media/video/bttv-i2c.c @@ -1,5 +1,5 @@ /* - $Id: bttv-i2c.c,v 1.17 2004/12/14 15:33:30 kraxel Exp $ + $Id: bttv-i2c.c,v 1.18 2005/02/16 12:14:10 kraxel Exp $ bttv-i2c.c -- all the i2c code is here @@ -39,7 +39,6 @@ static struct i2c_adapter bttv_i2c_adap_hw_template; static struct i2c_client bttv_i2c_client_template; static int attach_inform(struct i2c_client *client); -static int detach_inform(struct i2c_client *client); static int i2c_debug = 0; static int i2c_hw = 0; @@ -112,7 +111,6 @@ static struct i2c_adapter bttv_i2c_adap_sw_template = { I2C_DEVNAME("bt848"), .id = I2C_HW_B_BT848, .client_register = attach_inform, - .client_unregister = detach_inform, }; /* ----------------------------------------------------------------------- */ @@ -290,7 +288,6 @@ static struct i2c_adapter bttv_i2c_adap_hw_template = { .id = I2C_ALGO_BIT | I2C_HW_B_BT848 /* FIXME */, .algo = &bttv_algo, .client_register = attach_inform, - .client_unregister = detach_inform, }; /* ----------------------------------------------------------------------- */ @@ -305,26 +302,12 @@ static int attach_inform(struct i2c_client *client) if (btv->pinnacle_id != UNSET) bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE, &btv->pinnacle_id); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - bttv_i2c_info(&btv->c, client, 1); -#endif - if (bttv_debug) printk("bttv%d: i2c attach [client=%s]\n", btv->c.nr, i2c_clientname(client)); return 0; } -static int detach_inform(struct i2c_client *client) -{ - struct bttv *btv = i2c_get_adapdata(client->adapter); - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - bttv_i2c_info(&btv->c, client, 0); -#endif - return 0; -} - void bttv_call_i2c_clients(struct bttv *btv, unsigned int cmd, void *arg) { if (0 != btv->i2c_rc) diff --git a/linux/drivers/media/video/bttv.h b/linux/drivers/media/video/bttv.h index 586b3c32c..40d94f47e 100644 --- a/linux/drivers/media/video/bttv.h +++ b/linux/drivers/media/video/bttv.h @@ -1,5 +1,5 @@ /* - * $Id: bttv.h,v 1.15 2005/01/24 17:37:23 kraxel Exp $ + * $Id: bttv.h,v 1.16 2005/02/16 12:14:10 kraxel Exp $ * * bttv - Bt848 frame grabber driver * @@ -309,8 +309,6 @@ struct bttv_sub_driver { struct device_driver drv; char wanted[BUS_ID_SIZE]; void (*gpio_irq)(struct bttv_sub_device *sub); - void (*i2c_info)(struct bttv_sub_device *sub, - struct i2c_client *client, int attach); }; #define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv) diff --git a/linux/drivers/media/video/bttvp.h b/linux/drivers/media/video/bttvp.h index 5ae21acfb..0133eb616 100644 --- a/linux/drivers/media/video/bttvp.h +++ b/linux/drivers/media/video/bttvp.h @@ -1,5 +1,5 @@ /* - $Id: bttvp.h,v 1.16 2005/01/24 17:37:23 kraxel Exp $ + $Id: bttvp.h,v 1.17 2005/02/16 12:14:10 kraxel Exp $ bttv - Bt848 frame grabber driver @@ -220,7 +220,6 @@ extern struct bus_type bttv_sub_bus_type; int bttv_sub_add_device(struct bttv_core *core, char *name); int bttv_sub_del_devices(struct bttv_core *core); void bttv_gpio_irq(struct bttv_core *core); -void bttv_i2c_info(struct bttv_core *core, struct i2c_client *client, int attach); #endif |