提交 d7800d4e 编写于 作者: D Devin Heitmueller 提交者: Mauro Carvalho Chehab

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: NDevin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: NMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 bdd33563
...@@ -192,14 +192,19 @@ static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = { ...@@ -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_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_readreg(struct xc5000_priv *priv, u16 reg, u16 *val);
static int xc5000_TunerReset(struct dvb_frontend *fe); static int xc5000_TunerReset(struct dvb_frontend *fe);
static int xc_send_i2c_data(struct xc5000_priv *priv, u8 *buf, int len) static int xc_send_i2c_data(struct xc5000_priv *priv, u8 *buf, int len)
{ {
return xc5000_writeregs(priv, buf, len) struct i2c_msg msg = { .addr = priv->i2c_props.addr,
? XC_RESULT_I2C_WRITE_FAILURE : XC_RESULT_SUCCESS; .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 /* 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,19 +533,6 @@ static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val)
return XC_RESULT_SUCCESS; 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) static int xc5000_fwupload(struct dvb_frontend *fe)
{ {
struct xc5000_priv *priv = fe->tuner_priv; struct xc5000_priv *priv = fe->tuner_priv;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册