From bf51a8c5e0b6133b929eb7d7456e99a605f8168c Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 9 Mar 2013 08:16:46 +0000 Subject: i2c: Ignore return value of i2c_del_adapter() i2c_del_adapter() always returns 0. So all checks testing whether it will be non zero will always evaluate to false and the conditional code is dead code. This patch updates all callers of i2c_del_mux_adapter() to ignore the return value and assume that it will always succeed (which it will). In a subsequent patch the return type of i2c_del_adapter() will be made void. Signed-off-by: Lars-Peter Clausen Acked-by: Ben Hutchings Reviewed-by: Jean Delvare Acked-by: Shawn Guo Signed-off-by: Wolfram Sang --- drivers/media/pci/bt8xx/bttv-input.c | 6 +++--- drivers/media/pci/mantis/mantis_i2c.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c index 04207a799055..f42d26d7ed78 100644 --- a/drivers/media/pci/bt8xx/bttv-input.c +++ b/drivers/media/pci/bt8xx/bttv-input.c @@ -413,10 +413,10 @@ void init_bttv_i2c_ir(struct bttv *btv) int fini_bttv_i2c(struct bttv *btv) { - if (0 != btv->i2c_rc) - return 0; + if (btv->i2c_rc == 0) + i2c_del_adapter(&btv->c.i2c_adap); - return i2c_del_adapter(&btv->c.i2c_adap); + return 0; } int bttv_input_init(struct bttv *btv) diff --git a/drivers/media/pci/mantis/mantis_i2c.c b/drivers/media/pci/mantis/mantis_i2c.c index 937fb9d50213..895ddba3c0fb 100644 --- a/drivers/media/pci/mantis/mantis_i2c.c +++ b/drivers/media/pci/mantis/mantis_i2c.c @@ -261,6 +261,8 @@ int mantis_i2c_exit(struct mantis_pci *mantis) mmwrite((intmask & ~MANTIS_INT_I2CDONE), MANTIS_INT_MASK); dprintk(MANTIS_DEBUG, 1, "Removing I2C adapter"); - return i2c_del_adapter(&mantis->adapter); + i2c_del_adapter(&mantis->adapter); + + return 0; } EXPORT_SYMBOL_GPL(mantis_i2c_exit); -- cgit v1.2.3