diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-16 18:20:06 -0500 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2008-11-16 18:20:06 -0500 |
commit | 41e77d1f0a36b105066e184a540cbd98e4f7caf0 (patch) | |
tree | 86c375d640d6a4764de5020863f5b9be1a225e23 | |
parent | dae6cf7668ce870a676f7770d4ff930566b8ea2c (diff) | |
download | mediapointer-dvb-s2-41e77d1f0a36b105066e184a540cbd98e4f7caf0.tar.gz mediapointer-dvb-s2-41e77d1f0a36b105066e184a540cbd98e4f7caf0.tar.bz2 |
xc5000: cleanup i2c write routines
From: Devin Heitmueller <devin.heitmueller@gmail.com>
Cleanup the i2c write routine, getting rid of a passthrough function with only
one caller
Priority: normal
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
-rw-r--r-- | linux/drivers/media/common/tuners/xc5000.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/linux/drivers/media/common/tuners/xc5000.c b/linux/drivers/media/common/tuners/xc5000.c index f199e2995..2945075d5 100644 --- a/linux/drivers/media/common/tuners/xc5000.c +++ b/linux/drivers/media/common/tuners/xc5000.c @@ -192,14 +192,19 @@ static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = { }; static int xc5000_is_firmware_loaded(struct dvb_frontend *fe); -static int xc5000_writeregs(struct xc5000_priv *priv, u8 *buf, u8 len); static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val); static int xc5000_TunerReset(struct dvb_frontend *fe); static int xc_send_i2c_data(struct xc5000_priv *priv, u8 *buf, int len) { - return xc5000_writeregs(priv, buf, len) - ? XC_RESULT_I2C_WRITE_FAILURE : XC_RESULT_SUCCESS; + struct i2c_msg msg = { .addr = priv->i2c_props.addr, + .flags = 0, .buf = buf, .len = len }; + + if (i2c_transfer(priv->i2c_props.adap, &msg, 1) != 1) { + printk(KERN_ERR "xc5000: I2C write failed (len=%i)\n", len); + return XC_RESULT_I2C_WRITE_FAILURE; + } + return XC_RESULT_SUCCESS; } /* This routine is never used because the only time we read data from the @@ -547,19 +552,6 @@ static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val) return XC_RESULT_SUCCESS; } -static int xc5000_writeregs(struct xc5000_priv *priv, u8 *buf, u8 len) -{ - struct i2c_msg msg = { .addr = priv->i2c_props.addr, - .flags = 0, .buf = buf, .len = len }; - - if (i2c_transfer(priv->i2c_props.adap, &msg, 1) != 1) { - printk(KERN_ERR "xc5000: I2C write failed (len=%i)\n", - (int)len); - return -EREMOTEIO; - } - return 0; -} - static int xc5000_fwupload(struct dvb_frontend *fe) { struct xc5000_priv *priv = fe->tuner_priv; |