aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Sakamoto2017-01-05 21:48:10 +0900
committerTakashi Iwai2017-01-05 16:58:06 +0100
commitfcbe08d469bd3778e691e3b0f156d51f8b1ba2e4 (patch)
treef207b04b67ed5f64b0e7b58b38b4417f2a5bdb83
parent39feaf2d0a2e1844a7d4c26ac1fac66176a15515 (diff)
ALSA: dice: enclose identifiers referred by single function
Some identifiers are referred just by one functions. In this case, they can be put into the function definition. This brings two merits; readers can easily follow codes related to the identifiers, developers are free from name conflict. This commit moves such identifiers to each function definition. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/firewire/dice/dice-midi.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sound/firewire/dice/dice-midi.c b/sound/firewire/dice/dice-midi.c
index a040617505a7..cdf71c211342 100644
--- a/sound/firewire/dice/dice-midi.c
+++ b/sound/firewire/dice/dice-midi.c
@@ -78,18 +78,6 @@ static void midi_playback_trigger(struct snd_rawmidi_substream *substrm, int up)
spin_unlock_irqrestore(&dice->lock, flags);
}
-static struct snd_rawmidi_ops capture_ops = {
- .open = midi_open,
- .close = midi_close,
- .trigger = midi_capture_trigger,
-};
-
-static struct snd_rawmidi_ops playback_ops = {
- .open = midi_open,
- .close = midi_close,
- .trigger = midi_playback_trigger,
-};
-
static void set_midi_substream_names(struct snd_dice *dice,
struct snd_rawmidi_str *str)
{
@@ -103,6 +91,16 @@ static void set_midi_substream_names(struct snd_dice *dice,
int snd_dice_create_midi(struct snd_dice *dice)
{
+ static struct snd_rawmidi_ops capture_ops = {
+ .open = midi_open,
+ .close = midi_close,
+ .trigger = midi_capture_trigger,
+ };
+ static struct snd_rawmidi_ops playback_ops = {
+ .open = midi_open,
+ .close = midi_close,
+ .trigger = midi_playback_trigger,
+ };
__be32 reg;
struct snd_rawmidi *rmidi;
struct snd_rawmidi_str *str;