forked from Minki/linux
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: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Reviewed-by: Takashi Iwai <tiwai@suse.de> Acked-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
588e7ac5b1
commit
07c986b9bb
@ -164,14 +164,11 @@ static int snd_bcm2835_playback_spdif_open(struct snd_pcm_substream *substream)
|
|||||||
return snd_bcm2835_playback_open_generic(substream, 1);
|
return snd_bcm2835_playback_open_generic(substream, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* close callback */
|
|
||||||
static int snd_bcm2835_playback_close(struct snd_pcm_substream *substream)
|
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 bcm2835_alsa_stream *alsa_stream;
|
||||||
|
struct snd_pcm_runtime *runtime;
|
||||||
|
struct bcm2835_chip *chip;
|
||||||
|
|
||||||
chip = snd_pcm_substream_chip(substream);
|
chip = snd_pcm_substream_chip(substream);
|
||||||
mutex_lock(&chip->audio_mutex);
|
mutex_lock(&chip->audio_mutex);
|
||||||
@ -195,20 +192,17 @@ static int snd_bcm2835_playback_close(struct snd_pcm_substream *substream)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hw_params callback */
|
|
||||||
static int snd_bcm2835_pcm_hw_params(struct snd_pcm_substream *substream,
|
static int snd_bcm2835_pcm_hw_params(struct snd_pcm_substream *substream,
|
||||||
struct snd_pcm_hw_params *params)
|
struct snd_pcm_hw_params *params)
|
||||||
{
|
{
|
||||||
return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(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)
|
static int snd_bcm2835_pcm_hw_free(struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
return snd_pcm_lib_free_pages(substream);
|
return snd_pcm_lib_free_pages(substream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* prepare callback */
|
|
||||||
static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
|
static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream *substream)
|
||||||
{
|
{
|
||||||
struct bcm2835_chip *chip = snd_pcm_substream_chip(substream);
|
struct bcm2835_chip *chip = snd_pcm_substream_chip(substream);
|
||||||
|
@ -94,9 +94,9 @@ static void audio_vchi_callback(void *param,
|
|||||||
void *msg_handle)
|
void *msg_handle)
|
||||||
{
|
{
|
||||||
struct bcm2835_audio_instance *instance = param;
|
struct bcm2835_audio_instance *instance = param;
|
||||||
int status;
|
|
||||||
int msg_len;
|
|
||||||
struct vc_audio_msg m;
|
struct vc_audio_msg m;
|
||||||
|
int msg_len;
|
||||||
|
int status;
|
||||||
|
|
||||||
if (reason != VCHI_CALLBACK_MSG_AVAILABLE)
|
if (reason != VCHI_CALLBACK_MSG_AVAILABLE)
|
||||||
return;
|
return;
|
||||||
|
@ -161,8 +161,8 @@ static int snd_add_child_device(struct device *dev,
|
|||||||
struct bcm2835_audio_driver *audio_driver,
|
struct bcm2835_audio_driver *audio_driver,
|
||||||
u32 numchans)
|
u32 numchans)
|
||||||
{
|
{
|
||||||
struct snd_card *card;
|
|
||||||
struct bcm2835_chip *chip;
|
struct bcm2835_chip *chip;
|
||||||
|
struct snd_card *card;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = snd_card_new(dev, -1, NULL, THIS_MODULE, sizeof(*chip), &card);
|
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)
|
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_per_driver = 0;
|
||||||
int extrachannels_remainder = 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++)
|
for (i = 0; i < ARRAY_SIZE(children_devices); i++)
|
||||||
if (*children_devices[i].is_enabled)
|
if (*children_devices[i].is_enabled)
|
||||||
@ -258,9 +258,9 @@ static int snd_add_child_devices(struct device *device, u32 numchans)
|
|||||||
extrachannels_remainder);
|
extrachannels_remainder);
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(children_devices); i++) {
|
for (i = 0; i < ARRAY_SIZE(children_devices); i++) {
|
||||||
int err;
|
|
||||||
int numchannels_this_device;
|
|
||||||
struct bcm2835_audio_driver *audio_driver;
|
struct bcm2835_audio_driver *audio_driver;
|
||||||
|
int numchannels_this_device;
|
||||||
|
int err;
|
||||||
|
|
||||||
if (!*children_devices[i].is_enabled)
|
if (!*children_devices[i].is_enabled)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user