Commit 07c986b9 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Greg Kroah-Hartman

staging: bcm2835-audio: reorder variable declarations & remove trivial comments

When it comes to declaring variables it's preferred, when possible, to
use an inverted tree organization scheme.

Also, removes some comments that were useless.
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Acked-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 588e7ac5
......@@ -164,14 +164,11 @@ static int snd_bcm2835_playback_spdif_open(struct snd_pcm_substream *substream)
return snd_bcm2835_playback_open_generic(substream, 1);
}
/* close callback */
static int snd_bcm2835_playback_close(struct snd_pcm_substream *substream)
{
/* the hardware-specific codes will be here */
struct bcm2835_chip *chip;
struct snd_pcm_runtime *runtime;
struct bcm2835_alsa_stream *alsa_stream;
struct snd_pcm_runtime *runtime;
struct bcm2835_chip *chip;
chip = snd_pcm_substream_chip(substream);
mutex_lock(&chip->audio_mutex);
......@@ -195,20 +192,17 @@ static int snd_bcm2835_playback_close(struct snd_pcm_substream *substream)
return 0;
}
/* hw_params callback */
static int snd_bcm2835_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
}
/* hw_free callback */
static int snd_bcm2835_pcm_hw_free(struct snd_pcm_substream *substream)
{
return snd_pcm_lib_free_pages(substream);
}
/* prepare callback */
static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
{
struct bcm2835_chip *chip = snd_pcm_substream_chip(substream);
......
......@@ -94,9 +94,9 @@ static void audio_vchi_callback(void *param,
void *msg_handle)
{
struct bcm2835_audio_instance *instance = param;
int status;
int msg_len;
struct vc_audio_msg m;
int msg_len;
int status;
if (reason != VCHI_CALLBACK_MSG_AVAILABLE)
return;
......
......@@ -161,8 +161,8 @@ static int snd_add_child_device(struct device *dev,
struct bcm2835_audio_driver *audio_driver,
u32 numchans)
{
struct snd_card *card;
struct bcm2835_chip *chip;
struct snd_card *card;
int err;
err = snd_card_new(dev, -1, NULL, THIS_MODULE, sizeof(*chip), &card);
......@@ -225,12 +225,12 @@ static int snd_add_child_device(struct device *dev,
static int snd_add_child_devices(struct device *device, u32 numchans)
{
int i;
int count_devices = 0;
int minchannels = 0;
int extrachannels = 0;
int extrachannels_per_driver = 0;
int extrachannels_remainder = 0;
int count_devices = 0;
int extrachannels = 0;
int minchannels = 0;
int i;
for (i = 0; i < ARRAY_SIZE(children_devices); i++)
if (*children_devices[i].is_enabled)
......@@ -258,9 +258,9 @@ static int snd_add_child_devices(struct device *device, u32 numchans)
extrachannels_remainder);
for (i = 0; i < ARRAY_SIZE(children_devices); i++) {
int err;
int numchannels_this_device;
struct bcm2835_audio_driver *audio_driver;
int numchannels_this_device;
int err;
if (!*children_devices[i].is_enabled)
continue;
......
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