Commit 152419a6 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Greg Kroah-Hartman

staging: bcm2835-audio: use anonymous union in struct vc_audio_msg

In this case explicitly naming the union doesn't help overall code
comprehension and clutters it.
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 07c986b9
...@@ -104,15 +104,15 @@ static void audio_vchi_callback(void *param, ...@@ -104,15 +104,15 @@ static void audio_vchi_callback(void *param,
status = vchi_msg_dequeue(instance->vchi_handle, status = vchi_msg_dequeue(instance->vchi_handle,
&m, sizeof(m), &msg_len, VCHI_FLAGS_NONE); &m, sizeof(m), &msg_len, VCHI_FLAGS_NONE);
if (m.type == VC_AUDIO_MSG_TYPE_RESULT) { if (m.type == VC_AUDIO_MSG_TYPE_RESULT) {
instance->result = m.u.result.success; instance->result = m.result.success;
complete(&instance->msg_avail_comp); complete(&instance->msg_avail_comp);
} else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) { } else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) {
if (m.u.complete.cookie1 != VC_AUDIO_WRITE_COOKIE1 || if (m.complete.cookie1 != VC_AUDIO_WRITE_COOKIE1 ||
m.u.complete.cookie2 != VC_AUDIO_WRITE_COOKIE2) m.complete.cookie2 != VC_AUDIO_WRITE_COOKIE2)
dev_err(instance->dev, "invalid cookie\n"); dev_err(instance->dev, "invalid cookie\n");
else else
bcm2835_playback_fifo(instance->alsa_stream, bcm2835_playback_fifo(instance->alsa_stream,
m.u.complete.count); m.complete.count);
} else { } else {
dev_err(instance->dev, "unexpected callback type=%d\n", m.type); dev_err(instance->dev, "unexpected callback type=%d\n", m.type);
} }
...@@ -249,11 +249,11 @@ int bcm2835_audio_set_ctls(struct bcm2835_alsa_stream *alsa_stream) ...@@ -249,11 +249,11 @@ int bcm2835_audio_set_ctls(struct bcm2835_alsa_stream *alsa_stream)
struct vc_audio_msg m = {}; struct vc_audio_msg m = {};
m.type = VC_AUDIO_MSG_TYPE_CONTROL; m.type = VC_AUDIO_MSG_TYPE_CONTROL;
m.u.control.dest = chip->dest; m.control.dest = chip->dest;
if (!chip->mute) if (!chip->mute)
m.u.control.volume = CHIP_MIN_VOLUME; m.control.volume = CHIP_MIN_VOLUME;
else else
m.u.control.volume = alsa2chip(chip->volume); m.control.volume = alsa2chip(chip->volume);
return bcm2835_audio_send_msg(alsa_stream->instance, &m, true); return bcm2835_audio_send_msg(alsa_stream->instance, &m, true);
} }
...@@ -264,9 +264,9 @@ int bcm2835_audio_set_params(struct bcm2835_alsa_stream *alsa_stream, ...@@ -264,9 +264,9 @@ int bcm2835_audio_set_params(struct bcm2835_alsa_stream *alsa_stream,
{ {
struct vc_audio_msg m = { struct vc_audio_msg m = {
.type = VC_AUDIO_MSG_TYPE_CONFIG, .type = VC_AUDIO_MSG_TYPE_CONFIG,
.u.config.channels = channels, .config.channels = channels,
.u.config.samplerate = samplerate, .config.samplerate = samplerate,
.u.config.bps = bps, .config.bps = bps,
}; };
int err; int err;
...@@ -294,7 +294,7 @@ int bcm2835_audio_drain(struct bcm2835_alsa_stream *alsa_stream) ...@@ -294,7 +294,7 @@ int bcm2835_audio_drain(struct bcm2835_alsa_stream *alsa_stream)
{ {
struct vc_audio_msg m = { struct vc_audio_msg m = {
.type = VC_AUDIO_MSG_TYPE_STOP, .type = VC_AUDIO_MSG_TYPE_STOP,
.u.stop.draining = 1, .stop.draining = 1,
}; };
return bcm2835_audio_send_msg(alsa_stream->instance, &m, false); return bcm2835_audio_send_msg(alsa_stream->instance, &m, false);
...@@ -322,10 +322,10 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream, ...@@ -322,10 +322,10 @@ int bcm2835_audio_write(struct bcm2835_alsa_stream *alsa_stream,
struct bcm2835_audio_instance *instance = alsa_stream->instance; struct bcm2835_audio_instance *instance = alsa_stream->instance;
struct vc_audio_msg m = { struct vc_audio_msg m = {
.type = VC_AUDIO_MSG_TYPE_WRITE, .type = VC_AUDIO_MSG_TYPE_WRITE,
.u.write.count = size, .write.count = size,
.u.write.max_packet = instance->max_packet, .write.max_packet = instance->max_packet,
.u.write.cookie1 = VC_AUDIO_WRITE_COOKIE1, .write.cookie1 = VC_AUDIO_WRITE_COOKIE1,
.u.write.cookie2 = VC_AUDIO_WRITE_COOKIE2, .write.cookie2 = VC_AUDIO_WRITE_COOKIE2,
}; };
unsigned int count; unsigned int count;
int err, status; int err, status;
......
...@@ -93,7 +93,7 @@ struct vc_audio_msg { ...@@ -93,7 +93,7 @@ struct vc_audio_msg {
struct vc_audio_write write; struct vc_audio_write write;
struct vc_audio_result result; struct vc_audio_result result;
struct vc_audio_complete complete; struct vc_audio_complete complete;
} u; };
}; };
#endif /* _VC_AUDIO_DEFS_H_ */ #endif /* _VC_AUDIO_DEFS_H_ */
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