Commit 9f90f537 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: em28xx-audio: fix coding style issues

There are a number of coding style issues at em28xx-audio.
Fix them, by using checkpatch in strict mode to point for it.
Automatic fixes with --fix-inplace were complemented by manual
work.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 2e1e84c5
...@@ -103,7 +103,7 @@ static void em28xx_audio_isocirq(struct urb *urb) ...@@ -103,7 +103,7 @@ static void em28xx_audio_isocirq(struct urb *urb)
case -ESHUTDOWN: case -ESHUTDOWN:
return; return;
default: /* error */ default: /* error */
dprintk("urb completition error %d.\n", urb->status); dprintk("urb completion error %d.\n", urb->status);
break; break;
} }
...@@ -165,12 +165,11 @@ static void em28xx_audio_isocirq(struct urb *urb) ...@@ -165,12 +165,11 @@ static void em28xx_audio_isocirq(struct urb *urb)
dev_err(&dev->intf->dev, dev_err(&dev->intf->dev,
"resubmit of audio urb failed (error=%i)\n", "resubmit of audio urb failed (error=%i)\n",
status); status);
return;
} }
static int em28xx_init_audio_isoc(struct em28xx *dev) static int em28xx_init_audio_isoc(struct em28xx *dev)
{ {
int i, errCode; int i, err;
dprintk("Starting isoc transfers\n"); dprintk("Starting isoc transfers\n");
...@@ -179,16 +178,15 @@ static int em28xx_init_audio_isoc(struct em28xx *dev) ...@@ -179,16 +178,15 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
memset(dev->adev.transfer_buffer[i], 0x80, memset(dev->adev.transfer_buffer[i], 0x80,
dev->adev.urb[i]->transfer_buffer_length); dev->adev.urb[i]->transfer_buffer_length);
errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); err = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
if (errCode) { if (err) {
dev_err(&dev->intf->dev, dev_err(&dev->intf->dev,
"submit of audio urb failed (error=%i)\n", "submit of audio urb failed (error=%i)\n",
errCode); err);
em28xx_deinit_isoc_audio(dev); em28xx_deinit_isoc_audio(dev);
atomic_set(&dev->adev.stream_started, 0); atomic_set(&dev->adev.stream_started, 0);
return errCode; return err;
} }
} }
return 0; return 0;
...@@ -268,14 +266,17 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) ...@@ -268,14 +266,17 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
if (nonblock) { if (nonblock) {
if (!mutex_trylock(&dev->lock)) if (!mutex_trylock(&dev->lock))
return -EAGAIN; return -EAGAIN;
} else } else {
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
}
runtime->hw = snd_em28xx_hw_capture; runtime->hw = snd_em28xx_hw_capture;
if (dev->adev.users == 0) { if (dev->adev.users == 0) {
if (dev->alt == 0 || dev->is_audio_only) { if (!dev->alt || dev->is_audio_only) {
struct usb_device *udev = interface_to_usbdev(dev->intf); struct usb_device *udev;
udev = interface_to_usbdev(dev->intf);
if (dev->is_audio_only) if (dev->is_audio_only)
/* audio is on a separate interface */ /* audio is on a separate interface */
...@@ -367,9 +368,11 @@ static int snd_em28xx_hw_capture_params(struct snd_pcm_substream *substream, ...@@ -367,9 +368,11 @@ static int snd_em28xx_hw_capture_params(struct snd_pcm_substream *substream,
if (ret < 0) if (ret < 0)
return ret; return ret;
#if 0 #if 0
/* TODO: set up em28xx audio chip to deliver the correct audio format, /*
current default is 48000hz multiplexed => 96000hz mono * TODO: set up em28xx audio chip to deliver the correct audio format,
which shouldn't matter since analogue TV only supports mono */ * current default is 48000hz multiplexed => 96000hz mono
* which shouldn't matter since analogue TV only supports mono
*/
unsigned int channels, rate, format; unsigned int channels, rate, format;
format = params_format(hw_params); format = params_format(hw_params);
...@@ -513,8 +516,9 @@ static int em28xx_vol_put(struct snd_kcontrol *kcontrol, ...@@ -513,8 +516,9 @@ static int em28xx_vol_put(struct snd_kcontrol *kcontrol,
if (nonblock) { if (nonblock) {
if (!mutex_trylock(&dev->lock)) if (!mutex_trylock(&dev->lock))
return -EAGAIN; return -EAGAIN;
} else } else {
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
}
rc = em28xx_read_ac97(dev, kcontrol->private_value); rc = em28xx_read_ac97(dev, kcontrol->private_value);
if (rc < 0) if (rc < 0)
goto err; goto err;
...@@ -551,8 +555,9 @@ static int em28xx_vol_get(struct snd_kcontrol *kcontrol, ...@@ -551,8 +555,9 @@ static int em28xx_vol_get(struct snd_kcontrol *kcontrol,
if (nonblock) { if (nonblock) {
if (!mutex_trylock(&dev->lock)) if (!mutex_trylock(&dev->lock))
return -EAGAIN; return -EAGAIN;
} else } else {
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
}
val = em28xx_read_ac97(dev, kcontrol->private_value); val = em28xx_read_ac97(dev, kcontrol->private_value);
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
if (val < 0) if (val < 0)
...@@ -586,8 +591,9 @@ static int em28xx_vol_put_mute(struct snd_kcontrol *kcontrol, ...@@ -586,8 +591,9 @@ static int em28xx_vol_put_mute(struct snd_kcontrol *kcontrol,
if (nonblock) { if (nonblock) {
if (!mutex_trylock(&dev->lock)) if (!mutex_trylock(&dev->lock))
return -EAGAIN; return -EAGAIN;
} else } else {
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
}
rc = em28xx_read_ac97(dev, kcontrol->private_value); rc = em28xx_read_ac97(dev, kcontrol->private_value);
if (rc < 0) if (rc < 0)
goto err; goto err;
...@@ -627,8 +633,9 @@ static int em28xx_vol_get_mute(struct snd_kcontrol *kcontrol, ...@@ -627,8 +633,9 @@ static int em28xx_vol_get_mute(struct snd_kcontrol *kcontrol,
if (nonblock) { if (nonblock) {
if (!mutex_trylock(&dev->lock)) if (!mutex_trylock(&dev->lock))
return -EAGAIN; return -EAGAIN;
} else } else {
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
}
val = em28xx_read_ac97(dev, kcontrol->private_value); val = em28xx_read_ac97(dev, kcontrol->private_value);
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
if (val < 0) if (val < 0)
...@@ -836,9 +843,8 @@ static int em28xx_audio_urb_init(struct em28xx *dev) ...@@ -836,9 +843,8 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
dev->adev.transfer_buffer = kcalloc(num_urb, dev->adev.transfer_buffer = kcalloc(num_urb,
sizeof(*dev->adev.transfer_buffer), sizeof(*dev->adev.transfer_buffer),
GFP_ATOMIC); GFP_ATOMIC);
if (!dev->adev.transfer_buffer) { if (!dev->adev.transfer_buffer)
return -ENOMEM; return -ENOMEM;
}
dev->adev.urb = kcalloc(num_urb, sizeof(*dev->adev.urb), GFP_ATOMIC); dev->adev.urb = kcalloc(num_urb, sizeof(*dev->adev.urb), GFP_ATOMIC);
if (!dev->adev.urb) { if (!dev->adev.urb) {
...@@ -899,9 +905,11 @@ static int em28xx_audio_init(struct em28xx *dev) ...@@ -899,9 +905,11 @@ static int em28xx_audio_init(struct em28xx *dev)
int err; int err;
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) { if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) {
/* This device does not support the extension (in this case /*
the device is expecting the snd-usb-audio module or * This device does not support the extension (in this case
doesn't have analog audio support at all) */ * the device is expecting the snd-usb-audio module or
* doesn't have analog audio support at all)
*/
return 0; return 0;
} }
...@@ -977,13 +985,15 @@ static int em28xx_audio_init(struct em28xx *dev) ...@@ -977,13 +985,15 @@ static int em28xx_audio_init(struct em28xx *dev)
static int em28xx_audio_fini(struct em28xx *dev) static int em28xx_audio_fini(struct em28xx *dev)
{ {
if (dev == NULL) if (!dev)
return 0; return 0;
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) { if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) {
/* This device does not support the extension (in this case /*
the device is expecting the snd-usb-audio module or * This device does not support the extension (in this case
doesn't have analog audio support at all) */ * the device is expecting the snd-usb-audio module or
* doesn't have analog audio support at all)
*/
return 0; return 0;
} }
...@@ -1005,7 +1015,7 @@ static int em28xx_audio_fini(struct em28xx *dev) ...@@ -1005,7 +1015,7 @@ static int em28xx_audio_fini(struct em28xx *dev)
static int em28xx_audio_suspend(struct em28xx *dev) static int em28xx_audio_suspend(struct em28xx *dev)
{ {
if (dev == NULL) if (!dev)
return 0; return 0;
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
...@@ -1019,7 +1029,7 @@ static int em28xx_audio_suspend(struct em28xx *dev) ...@@ -1019,7 +1029,7 @@ static int em28xx_audio_suspend(struct em28xx *dev)
static int em28xx_audio_resume(struct em28xx *dev) static int em28xx_audio_resume(struct em28xx *dev)
{ {
if (dev == NULL) if (!dev)
return 0; return 0;
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment