forked from Minki/linux
V4L/DVB (9261): xc5000: Checkpatch compliance
xc5000: Checkpatch compliance Signed-off-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
93504abfeb
commit
8f3cd53006
|
@ -138,11 +138,11 @@ struct xc5000_priv {
|
|||
immediately the length of the following transaction.
|
||||
|
||||
*/
|
||||
typedef struct {
|
||||
struct XC_TV_STANDARD {
|
||||
char *Name;
|
||||
u16 AudioMode;
|
||||
u16 VideoMode;
|
||||
} XC_TV_STANDARD;
|
||||
};
|
||||
|
||||
/* Tuner standards */
|
||||
#define MN_NTSC_PAL_BTSC 0
|
||||
|
@ -169,7 +169,7 @@ typedef struct {
|
|||
#define FM_Radio_INPUT2 21
|
||||
#define FM_Radio_INPUT1 22
|
||||
|
||||
static XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
|
||||
static struct XC_TV_STANDARD XC5000_Standard[MAX_TV_STANDARD] = {
|
||||
{"M/N-NTSC/PAL-BTSC", 0x0400, 0x8020},
|
||||
{"M/N-NTSC/PAL-A2", 0x0600, 0x8020},
|
||||
{"M/N-NTSC/PAL-EIAJ", 0x0440, 0x8020},
|
||||
|
@ -308,7 +308,8 @@ static int xc_load_i2c_sequence(struct dvb_frontend *fe, const u8 *i2c_sequence)
|
|||
u8 buf[XC_MAX_I2C_WRITE_LENGTH];
|
||||
|
||||
index = 0;
|
||||
while ((i2c_sequence[index]!=0xFF) || (i2c_sequence[index+1]!=0xFF)) {
|
||||
while ((i2c_sequence[index] != 0xFF) ||
|
||||
(i2c_sequence[index + 1] != 0xFF)) {
|
||||
len = i2c_sequence[index] * 256 + i2c_sequence[index+1];
|
||||
if (len == 0x0000) {
|
||||
/* RESET command */
|
||||
|
@ -329,15 +330,17 @@ static int xc_load_i2c_sequence(struct dvb_frontend *fe, const u8 *i2c_sequence)
|
|||
buf[1] = i2c_sequence[index + 1];
|
||||
pos = 2;
|
||||
while (pos < len) {
|
||||
if ((len - pos) > XC_MAX_I2C_WRITE_LENGTH - 2) {
|
||||
nbytes_to_send = XC_MAX_I2C_WRITE_LENGTH;
|
||||
} else {
|
||||
if ((len - pos) > XC_MAX_I2C_WRITE_LENGTH - 2)
|
||||
nbytes_to_send =
|
||||
XC_MAX_I2C_WRITE_LENGTH;
|
||||
else
|
||||
nbytes_to_send = (len - pos + 2);
|
||||
}
|
||||
for (i = 2; i < nbytes_to_send; i++) {
|
||||
buf[i] = i2c_sequence[index + pos + i - 2];
|
||||
buf[i] = i2c_sequence[index + pos +
|
||||
i - 2];
|
||||
}
|
||||
result = xc_send_i2c_data(priv, buf, nbytes_to_send);
|
||||
result = xc_send_i2c_data(priv, buf,
|
||||
nbytes_to_send);
|
||||
|
||||
if (result != XC_RESULT_SUCCESS)
|
||||
return result;
|
||||
|
@ -386,8 +389,7 @@ static int xc_SetSignalSource(struct xc5000_priv *priv, u16 rf_mode)
|
|||
dprintk(1, "%s(%d) Source = %s\n", __func__, rf_mode,
|
||||
rf_mode == XC_RF_MODE_AIR ? "ANTENNA" : "CABLE");
|
||||
|
||||
if ((rf_mode != XC_RF_MODE_AIR) && (rf_mode != XC_RF_MODE_CABLE))
|
||||
{
|
||||
if ((rf_mode != XC_RF_MODE_AIR) && (rf_mode != XC_RF_MODE_CABLE)) {
|
||||
rf_mode = XC_RF_MODE_CABLE;
|
||||
printk(KERN_ERR
|
||||
"%s(), Invalid mode, defaulting to CABLE",
|
||||
|
@ -576,7 +578,8 @@ static int xc5000_fwupload(struct dvb_frontend* fe)
|
|||
printk(KERN_INFO "xc5000: waiting for firmware upload (%s)...\n",
|
||||
XC5000_DEFAULT_FIRMWARE);
|
||||
|
||||
ret = request_firmware(&fw, XC5000_DEFAULT_FIRMWARE, &priv->i2c_props.adap->dev);
|
||||
ret = request_firmware(&fw, XC5000_DEFAULT_FIRMWARE,
|
||||
&priv->i2c_props.adap->dev);
|
||||
if (ret) {
|
||||
printk(KERN_ERR "xc5000: Upload failed. (file not found?)\n");
|
||||
ret = XC_RESULT_RESET_FAILURE;
|
||||
|
@ -890,11 +893,9 @@ static int xc5000_sleep(struct dvb_frontend *fe)
|
|||
"xc5000: %s() unable to shutdown tuner\n",
|
||||
__func__);
|
||||
return -EREMOTEIO;
|
||||
}
|
||||
else {
|
||||
} else
|
||||
return XC_RESULT_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
static int xc5000_init(struct dvb_frontend *fe)
|
||||
{
|
||||
|
|
|
@ -56,6 +56,6 @@ static inline struct dvb_frontend* xc5000_attach(struct dvb_frontend *fe,
|
|||
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
#endif // CONFIG_MEDIA_TUNER_XC5000
|
||||
#endif
|
||||
|
||||
#endif // __XC5000_H__
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user