V4L/DVB: Staging: tm6000: Fix coding style issues

Fixed coding style issues founded by checkpatch.pl in files:
tm6000-alsa.c,tm6000-cards, tm6000-core.c, tm6000-dvb.c, tm6000-i2c.c,
tm6000-stds.c, tm6000-usb-isoc.h, tm6000.h

[mchehab@redhat.com: Fix some compilation breakages]
Signed-off-by: Timofey Trofimov <tumoxep@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Timofey Trofimov
2010-05-29 13:52:46 -03:00
committed by Mauro Carvalho Chehab
parent cee3926f5f
commit 52e0a72a0c
6 changed files with 154 additions and 171 deletions

View File

@@ -61,22 +61,21 @@ int tm6000_read_write_usb (struct tm6000_core *dev, u8 req_type, u8 req,
(req_type & USB_DIR_IN) ? " IN" : "OUT",
jiffies_to_msecs(jiffies-last),
jiffies_to_msecs(jiffies-ini),
req_type, req,value&0xff,value>>8, index&0xff, index>>8,
len&0xff, len>>8);
req_type, req, value&0xff, value>>8, index&0xff,
index>>8, len&0xff, len>>8);
last = jiffies;
n++;
if (!(req_type & USB_DIR_IN)) {
printk(">>> ");
for (i=0;i<len;i++) {
for (i = 0; i < len; i++)
printk(" %02x", buf[i]);
}
printk("\n");
}
}
ret = usb_control_msg(dev->udev, pipe, req, req_type, value, index, data,
len, USB_TIMEOUT);
ret = usb_control_msg(dev->udev, pipe, req, req_type, value, index,
data, len, USB_TIMEOUT);
if (req_type & USB_DIR_IN)
memcpy(buf, data, len);
@@ -89,9 +88,8 @@ int tm6000_read_write_usb (struct tm6000_core *dev, u8 req_type, u8 req,
printk("%s: Error #%d\n", __FUNCTION__, ret);
} else if (req_type & USB_DIR_IN) {
printk("<<< ");
for (i=0;i<len;i++) {
for (i = 0; i < len; i++)
printk(" %02x", buf[i]);
}
printk("\n");
}
}
@@ -294,12 +292,10 @@ int tm6000_init_analog_mode (struct tm6000_core *dev)
/* Enables soft reset */
tm6000_set_reg(dev, TM6010_REQ07_R3F_RESET, 0x01);
if (dev->scaler) {
if (dev->scaler)
tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x20);
} else {
/* Enable Hfilter and disable TS Drop err */
else /* Enable Hfilter and disable TS Drop err */
tm6000_set_reg(dev, TM6010_REQ07_RC0_ACTIVE_VIDEO_SOURCE, 0x80);
}
tm6000_set_reg(dev, TM6010_REQ07_RC3_HSTART1, 0x88);
tm6000_set_reg(dev, TM6010_REQ07_RD8_IR_WAKEUP_SEL, 0x23);
@@ -368,8 +364,6 @@ int tm6000_init_digital_mode (struct tm6000_core *dev)
tm6000_set_reg(dev, TM6010_REQ08_RF1_AADC_POWER_DOWN, 0xfe);
tm6000_read_write_usb(dev, 0xc0, 0x0e, 0x00c2, 0x0008, buf, 2);
printk(KERN_INFO"buf %#x %#x\n", buf[0], buf[1]);
} else {
tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x08);
tm6000_set_reg(dev, TM6010_REQ07_RFF_SOFT_RESET, 0x00);
@@ -595,11 +589,10 @@ int tm6000_init (struct tm6000_core *dev)
/* Check board version - maybe 10Moons specific */
board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
if (board >=0) {
if (board >= 0)
printk(KERN_INFO "Board version = 0x%08x\n", board);
} else {
else
printk(KERN_ERR "Error %i while retrieving board version\n", board);
}
rc = tm6000_cards_setup(dev);

View File

@@ -44,7 +44,7 @@ static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug message");
static void inline print_err_status (struct tm6000_core *dev,
static inline void print_err_status(struct tm6000_core *dev,
int packet, int status)
{
char *errmsg = "Unknown";
@@ -89,13 +89,11 @@ static void tm6000_urb_received(struct urb *urb)
int ret;
struct tm6000_core *dev = urb->context;
if(urb->status != 0) {
if (urb->status != 0)
print_err_status(dev, 0, urb->status);
}
else if(urb->actual_length>0){
else if (urb->actual_length > 0)
dvb_dmx_swfilter(&dev->dvb->demux, urb->transfer_buffer,
urb->actual_length);
}
if (dev->dvb->streams > 0) {
ret = usb_submit_urb(urb, GFP_ATOMIC);
@@ -146,19 +144,19 @@ int tm6000_start_stream(struct tm6000_core *dev)
ret = usb_clear_halt(dev->udev, pipe);
if (ret < 0) {
printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n",ret,__FUNCTION__);
printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n",
ret, __FUNCTION__);
return ret;
}
else {
} else
printk(KERN_ERR "tm6000: pipe resetted\n");
}
/* mutex_lock(&tm6000_driver.open_close_mutex); */
ret = usb_submit_urb(dvb->bulk_urb, GFP_KERNEL);
/* mutex_unlock(&tm6000_driver.open_close_mutex); */
if (ret) {
printk(KERN_ERR "tm6000: submit of urb failed (error=%i)\n",ret);
printk(KERN_ERR "tm6000: submit of urb failed (error=%i)\n",
ret);
kfree(dvb->bulk_urb->transfer_buffer);
usb_free_urb(dvb->bulk_urb);
@@ -194,16 +192,15 @@ int tm6000_start_feed(struct dvb_demux_feed *feed)
dvb->streams = 1;
/* mutex_init(&tm6000_dev->streming_mutex); */
tm6000_start_stream(dev);
}
else {
} else
++(dvb->streams);
}
mutex_unlock(&dvb->mutex);
return 0;
}
int tm6000_stop_feed(struct dvb_demux_feed *feed) {
int tm6000_stop_feed(struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
struct tm6000_core *dev = demux->priv;
struct tm6000_dvb *dvb = dev->dvb;
@@ -230,8 +227,8 @@ int tm6000_dvb_attach_frontend(struct tm6000_core *dev)
struct tm6000_dvb *dvb = dev->dvb;
if (dev->caps.has_zl10353) {
struct zl10353_config config =
{.demod_address = dev->demod_addr,
struct zl10353_config config = {
.demod_address = dev->demod_addr,
.no_tuner = 1,
.parallel_ts = 1,
.if2 = 45700,
@@ -240,8 +237,7 @@ int tm6000_dvb_attach_frontend(struct tm6000_core *dev)
dvb->frontend = dvb_attach(zl10353_attach, &config,
&dev->i2c_adap);
}
else {
} else {
printk(KERN_ERR "tm6000: no frontend defined for the device!\n");
return -1;
}
@@ -321,9 +317,8 @@ int register_dvb(struct tm6000_core *dev)
break;
}
}
} else {
} else
printk(KERN_ERR "tm6000: no frontend found\n");
}
dvb->demux.dmx.capabilities = DMX_TS_FILTERING | DMX_SECTION_FILTERING
| DMX_MEMORY_BASED_FILTERING;
@@ -388,7 +383,6 @@ void unregister_dvb(struct tm6000_core *dev)
dvb_unregister_adapter(&dvb->adapter);
mutex_destroy(&dvb->mutex);
/* mutex_unlock(&tm6000_driver.open_close_mutex); */
}
static int dvb_init(struct tm6000_core *dev)

View File

@@ -266,11 +266,10 @@ static int tm6000_i2c_eeprom(struct tm6000_core *dev,
if (0 == (i % 16))
printk(KERN_INFO "%s: i2c eeprom %02x:", dev->name, i);
printk(" %02x", eedata[i]);
if ((eedata[i] >= ' ') && (eedata[i] <= 'z')) {
if ((eedata[i] >= ' ') && (eedata[i] <= 'z'))
bytes[i%16] = eedata[i];
} else {
else
bytes[i%16] = '.';
}
i++;
@@ -305,7 +304,7 @@ static u32 functionality(struct i2c_adapter *adap)
}
#define mass_write(addr, reg, data...) \
{ const static u8 _val[] = data; \
{ static const u8 _val[] = data; \
rc = tm6000_read_write_usb(dev, USB_DIR_OUT | USB_TYPE_VENDOR, \
REQ_16_SET_GET_I2C_WR1_RDN, (reg<<8)+addr, 0x00, (u8 *) _val, \
ARRAY_SIZE(_val)); \

View File

@@ -763,11 +763,11 @@ static struct tm6000_std_settings svideo_stds[] = {
void tm6000_get_std_res(struct tm6000_core *dev)
{
/* Currently, those are the only supported resoltions */
if (dev->norm & V4L2_STD_525_60) {
if (dev->norm & V4L2_STD_525_60)
dev->height = 480;
} else {
else
dev->height = 576;
}
dev->width = 720;
}

View File

@@ -20,8 +20,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// Use the tm6000-hack, instead of the proper initialization code
//#define HACK 1
/* Use the tm6000-hack, instead of the proper initialization code i*/
/* #define HACK 1 */
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
@@ -263,7 +263,6 @@ int tm6000_get_reg16(struct tm6000_core *dev, u8 req, u16 value, u16 index);
int tm6000_get_reg32(struct tm6000_core *dev, u8 req, u16 value, u16 index);
int tm6000_set_reg(struct tm6000_core *dev, u8 req, u16 value, u16 index);
int tm6000_i2c_reset(struct tm6000_core *dev, u16 tsleep);
int tm6000_init(struct tm6000_core *dev);
int tm6000_init_analog_mode(struct tm6000_core *dev);
@@ -333,5 +332,3 @@ extern int tm6000_debug;
#define tm6000_err(fmt, arg...) do {\
printk(KERN_ERR "tm6000 %s :"fmt, \
__FUNCTION__ , ##arg); } while (0)