diff options
author | Alexey Klimov <klimov.linux@gmail.com> | 2008-10-19 23:50:27 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-21 14:28:42 -0200 |
commit | 223377e76d68c8015f1c809d3c831423de7b1fb6 (patch) | |
tree | 4c3b804cfe13712a870100071c0f1a451511d34f /drivers/media/radio | |
parent | 448441cf2f97da478c51852fac153ae6bb3430d8 (diff) | |
download | blackbird-op-linux-223377e76d68c8015f1c809d3c831423de7b1fb6.tar.gz blackbird-op-linux-223377e76d68c8015f1c809d3c831423de7b1fb6.zip |
V4L/DVB (9304): dsbr100: CodingStyle issue
Fixed few coding style issues in dsbr100
Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r-- | drivers/media/radio/dsbr100.c | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index 8ddc8bfcb2cf..e88c58ea1b76 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c @@ -171,11 +171,11 @@ static int dsbr100_start(struct dsbr100_device *radio) if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), USB_REQ_GET_STATUS, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x00, 0xC7, radio->transfer_buffer, 8, 300)<0 || + 0x00, 0xC7, radio->transfer_buffer, 8, 300) < 0 || usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), DSB100_ONOFF, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x01, 0x00, radio->transfer_buffer, 8, 300)<0) + 0x01, 0x00, radio->transfer_buffer, 8, 300) < 0) return -1; radio->muted=0; return (radio->transfer_buffer)[0]; @@ -188,11 +188,11 @@ static int dsbr100_stop(struct dsbr100_device *radio) if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), USB_REQ_GET_STATUS, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x16, 0x1C, radio->transfer_buffer, 8, 300)<0 || + 0x16, 0x1C, radio->transfer_buffer, 8, 300) < 0 || usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), DSB100_ONOFF, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x00, 0x00, radio->transfer_buffer, 8, 300)<0) + 0x00, 0x00, radio->transfer_buffer, 8, 300) < 0) return -1; radio->muted=1; return (radio->transfer_buffer)[0]; @@ -201,24 +201,24 @@ static int dsbr100_stop(struct dsbr100_device *radio) /* set a frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */ static int dsbr100_setfreq(struct dsbr100_device *radio, int freq) { - freq = (freq/16*80)/1000+856; + freq = (freq / 16 * 80) / 1000 + 856; if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), DSB100_TUNE, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - (freq>>8)&0x00ff, freq&0xff, - radio->transfer_buffer, 8, 300)<0 || + (freq >> 8) & 0x00ff, freq & 0xff, + radio->transfer_buffer, 8, 300) < 0 || usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), USB_REQ_GET_STATUS, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x96, 0xB7, radio->transfer_buffer, 8, 300)<0 || + 0x96, 0xB7, radio->transfer_buffer, 8, 300) < 0 || usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), USB_REQ_GET_STATUS, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x00, 0x24, radio->transfer_buffer, 8, 300)<0) { + 0x00, 0x24, radio->transfer_buffer, 8, 300) < 0) { radio->stereo = -1; return -1; } - radio->stereo = ! ((radio->transfer_buffer)[0]&0x01); + radio->stereo = !((radio->transfer_buffer)[0] & 0x01); return (radio->transfer_buffer)[0]; } @@ -229,10 +229,10 @@ static void dsbr100_getstat(struct dsbr100_device *radio) if (usb_control_msg(radio->usbdev, usb_rcvctrlpipe(radio->usbdev, 0), USB_REQ_GET_STATUS, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x00 , 0x24, radio->transfer_buffer, 8, 300)<0) + 0x00 , 0x24, radio->transfer_buffer, 8, 300) < 0) radio->stereo = -1; else - radio->stereo = ! (radio->transfer_buffer[0]&0x01); + radio->stereo = !(radio->transfer_buffer[0] & 0x01); } @@ -282,9 +282,9 @@ static int vidioc_g_tuner(struct file *file, void *priv, dsbr100_getstat(radio); strcpy(v->name, "FM"); v->type = V4L2_TUNER_RADIO; - v->rangelow = FREQ_MIN*FREQ_MUL; - v->rangehigh = FREQ_MAX*FREQ_MUL; - v->rxsubchans = V4L2_TUNER_SUB_MONO|V4L2_TUNER_SUB_STEREO; + v->rangelow = FREQ_MIN * FREQ_MUL; + v->rangehigh = FREQ_MAX * FREQ_MUL; + v->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; v->capability = V4L2_TUNER_CAP_LOW; if(radio->stereo) v->audmode = V4L2_TUNER_MODE_STEREO; @@ -309,7 +309,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, struct dsbr100_device *radio = video_drvdata(file); radio->curfreq = f->frequency; - if (dsbr100_setfreq(radio, radio->curfreq)==-1) + if (dsbr100_setfreq(radio, radio->curfreq) == -1) dev_warn(&radio->usbdev->dev, "Set frequency failed\n"); return 0; } @@ -331,8 +331,7 @@ static int vidioc_queryctrl(struct file *file, void *priv, for (i = 0; i < ARRAY_SIZE(radio_qctrl); i++) { if (qc->id && qc->id == radio_qctrl[i].id) { - memcpy(qc, &(radio_qctrl[i]), - sizeof(*qc)); + memcpy(qc, &(radio_qctrl[i]), sizeof(*qc)); return 0; } } @@ -417,7 +416,7 @@ static int usb_dsbr100_open(struct inode *inode, struct file *file) radio->users = 1; radio->muted = 1; - if (dsbr100_start(radio)<0) { + if (dsbr100_start(radio) < 0) { dev_warn(&radio->usbdev->dev, "Radio did not start up properly\n"); radio->users = 0; @@ -485,13 +484,20 @@ static int usb_dsbr100_probe(struct usb_interface *intf, { struct dsbr100_device *radio; - if (!(radio = kmalloc(sizeof(struct dsbr100_device), GFP_KERNEL))) + radio = kmalloc(sizeof(struct dsbr100_device), GFP_KERNEL); + + if (!radio) return -ENOMEM; - if (!(radio->transfer_buffer = kmalloc(TB_LEN, GFP_KERNEL))) { + + radio->transfer_buffer = kmalloc(TB_LEN, GFP_KERNEL); + + if (!(radio->transfer_buffer)) { kfree(radio); return -ENOMEM; } - if (!(radio->videodev = video_device_alloc())) { + radio->videodev = video_device_alloc(); + + if (!(radio->videodev)) { kfree(radio->transfer_buffer); kfree(radio); return -ENOMEM; @@ -501,7 +507,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf, radio->removed = 0; radio->users = 0; radio->usbdev = interface_to_usbdev(intf); - radio->curfreq = FREQ_MIN*FREQ_MUL; + radio->curfreq = FREQ_MIN * FREQ_MUL; video_set_drvdata(radio->videodev, radio); if (video_register_device(radio->videodev, VFL_TYPE_RADIO, radio_nr) < 0) { dev_warn(&intf->dev, "Could not register video device\n"); |