diff options
author | Devin Heitmueller <devin.heitmueller@gmail.com> | 2008-11-16 18:20:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:21:05 -0400 |
commit | d7800d4ea977fa323d1529850ecc499b82df6884 (patch) | |
tree | 45df5b69a9f2de68458a3b8a86c6901a840a736d /drivers/media/common/tuners | |
parent | bdd335636a1afe1f30076915395874549be8cd35 (diff) |
V4L/DVB (11788): xc5000: cleanup i2c write routines
Cleanup the i2c write routine, getting rid of a passthrough function with only
one caller
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/tuners')
-rw-r--r-- | drivers/media/common/tuners/xc5000.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/media/common/tuners/xc5000.c b/drivers/media/common/tuners/xc5000.c index 759168af0e2a..7d83deca9e02 100644 --- a/drivers/media/common/tuners/xc5000.c +++ b/drivers/media/common/tuners/xc5000.c | |||
@@ -192,14 +192,19 @@ static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = { | |||
192 | }; | 192 | }; |
193 | 193 | ||
194 | static int xc5000_is_firmware_loaded(struct dvb_frontend *fe); | 194 | static int xc5000_is_firmware_loaded(struct dvb_frontend *fe); |
195 | static int xc5000_writeregs(struct xc5000_priv *priv, u8 *buf, u8 len); | ||
196 | static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val); | 195 | static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val); |
197 | static int xc5000_TunerReset(struct dvb_frontend *fe); | 196 | static int xc5000_TunerReset(struct dvb_frontend *fe); |
198 | 197 | ||
199 | static int xc_send_i2c_data(struct xc5000_priv *priv, u8 *buf, int len) | 198 | static int xc_send_i2c_data(struct xc5000_priv *priv, u8 *buf, int len) |
200 | { | 199 | { |
201 | return xc5000_writeregs(priv, buf, len) | 200 | struct i2c_msg msg = { .addr = priv->i2c_props.addr, |
202 | ? XC_RESULT_I2C_WRITE_FAILURE : XC_RESULT_SUCCESS; | 201 | .flags = 0, .buf = buf, .len = len }; |
202 | |||
203 | if (i2c_transfer(priv->i2c_props.adap, &msg, 1) != 1) { | ||
204 | printk(KERN_ERR "xc5000: I2C write failed (len=%i)\n", len); | ||
205 | return XC_RESULT_I2C_WRITE_FAILURE; | ||
206 | } | ||
207 | return XC_RESULT_SUCCESS; | ||
203 | } | 208 | } |
204 | 209 | ||
205 | /* This routine is never used because the only time we read data from the | 210 | /* This routine is never used because the only time we read data from the |
@@ -528,19 +533,6 @@ static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val) | |||
528 | return XC_RESULT_SUCCESS; | 533 | return XC_RESULT_SUCCESS; |
529 | } | 534 | } |
530 | 535 | ||
531 | static int xc5000_writeregs(struct xc5000_priv *priv, u8 *buf, u8 len) | ||
532 | { | ||
533 | struct i2c_msg msg = { .addr = priv->i2c_props.addr, | ||
534 | .flags = 0, .buf = buf, .len = len }; | ||
535 | |||
536 | if (i2c_transfer(priv->i2c_props.adap, &msg, 1) != 1) { | ||
537 | printk(KERN_ERR "xc5000: I2C write failed (len=%i)\n", | ||
538 | (int)len); | ||
539 | return -EREMOTEIO; | ||
540 | } | ||
541 | return 0; | ||
542 | } | ||
543 | |||
544 | static int xc5000_fwupload(struct dvb_frontend *fe) | 536 | static int xc5000_fwupload(struct dvb_frontend *fe) |
545 | { | 537 | { |
546 | struct xc5000_priv *priv = fe->tuner_priv; | 538 | struct xc5000_priv *priv = fe->tuner_priv; |