Commit 316638a5 authored by Kyle Chamberlin's avatar Kyle Chamberlin Committed by Takashi Iwai

ALSA: virmidi: fixed code style issues

Fixed some minor code style issues and also removed some
assignments inside of if conditionals.
Signed-off-by: default avatarKyle Chamberlin <kylechamberlin@project20million.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 31514bfb
...@@ -99,30 +99,33 @@ static int snd_virmidi_probe(struct platform_device *devptr) ...@@ -99,30 +99,33 @@ static int snd_virmidi_probe(struct platform_device *devptr)
if (midi_devs[dev] > MAX_MIDI_DEVICES) { if (midi_devs[dev] > MAX_MIDI_DEVICES) {
snd_printk(KERN_WARNING snd_printk(KERN_WARNING
"too much midi devices for virmidi %d: " "too much midi devices for virmidi %d: force to use %d\n",
"force to use %d\n", dev, MAX_MIDI_DEVICES); dev, MAX_MIDI_DEVICES);
midi_devs[dev] = MAX_MIDI_DEVICES; midi_devs[dev] = MAX_MIDI_DEVICES;
} }
for (idx = 0; idx < midi_devs[dev]; idx++) { for (idx = 0; idx < midi_devs[dev]; idx++) {
struct snd_rawmidi *rmidi; struct snd_rawmidi *rmidi;
struct snd_virmidi_dev *rdev; struct snd_virmidi_dev *rdev;
if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0)
err = snd_virmidi_new(card, idx, &rmidi);
if (err < 0)
goto __nodev; goto __nodev;
rdev = rmidi->private_data; rdev = rmidi->private_data;
vmidi->midi[idx] = rmidi; vmidi->midi[idx] = rmidi;
strcpy(rmidi->name, "Virtual Raw MIDI"); strcpy(rmidi->name, "Virtual Raw MIDI");
rdev->seq_mode = SNDRV_VIRMIDI_SEQ_DISPATCH; rdev->seq_mode = SNDRV_VIRMIDI_SEQ_DISPATCH;
} }
strcpy(card->driver, "VirMIDI"); strcpy(card->driver, "VirMIDI");
strcpy(card->shortname, "VirMIDI"); strcpy(card->shortname, "VirMIDI");
sprintf(card->longname, "Virtual MIDI Card %i", dev + 1); sprintf(card->longname, "Virtual MIDI Card %i", dev + 1);
if ((err = snd_card_register(card)) == 0) { err = snd_card_register(card);
if (err) {
platform_set_drvdata(devptr, card); platform_set_drvdata(devptr, card);
return 0; return 0;
} }
__nodev: __nodev:
snd_card_free(card); snd_card_free(card);
return err; return err;
} }
...@@ -157,13 +160,15 @@ static int __init alsa_card_virmidi_init(void) ...@@ -157,13 +160,15 @@ static int __init alsa_card_virmidi_init(void)
{ {
int i, cards, err; int i, cards, err;
if ((err = platform_driver_register(&snd_virmidi_driver)) < 0) err = platform_driver_register(&snd_virmidi_driver);
if (err < 0)
return err; return err;
cards = 0; cards = 0;
for (i = 0; i < SNDRV_CARDS; i++) { for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device; struct platform_device *device;
if (! enable[i])
if (!enable[i])
continue; continue;
device = platform_device_register_simple(SND_VIRMIDI_DRIVER, device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
i, NULL, 0); i, NULL, 0);
......
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