From: Rene Herman <rene.herman@keyaccess.nl>
To: Takashi Iwai <tiwai@suse.de>
Cc: ALSA devel <alsa-devel@alsa-project.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [ALSA 1/2] a few more -- continue on IS_ERR from platform device registration
Date: Thu, 13 Apr 2006 03:41:40 +0200 [thread overview]
Message-ID: <443DAC54.5010801@keyaccess.nl> (raw)
[-- Attachment #1: Type: text/plain, Size: 662 bytes --]
Hi Takashi
I previously only concerned myself with sound/isa. When I now checked
for more platform_device_register_simple() usages in ALSA I found a
couple more drivers that needed the same patches as already submitted
for all the ISA drivers.
This first one is the continue-on-iserr patch for sound/drivers. This
gets them all.
sound/drivers/dummy.c | 14 ++++----------
sound/drivers/mpu401/mpu401.c | 14 ++++----------
sound/drivers/serial-u16550.c | 14 ++++----------
sound/drivers/virmidi.c | 14 ++++----------
4 files changed, 16 insertions(+), 40 deletions(-)
Signed-off-by: Rene Herman <rene.herman@keyaccess.nl>
[-- Attachment #2: alsa_platform_iserr_remainder.diff --]
[-- Type: text/plain, Size: 3725 bytes --]
Index: mm/sound/drivers/mpu401/mpu401.c
===================================================================
--- mm.orig/sound/drivers/mpu401/mpu401.c 2006-04-13 01:37:08.000000000 +0200
+++ mm/sound/drivers/mpu401/mpu401.c 2006-04-13 01:37:40.000000000 +0200
@@ -252,10 +252,8 @@ static int __init alsa_card_mpu401_init(
#endif
device = platform_device_register_simple(SND_MPU401_DRIVER,
i, NULL, 0);
- if (IS_ERR(device)) {
- err = PTR_ERR(device);
- goto errout;
- }
+ if (IS_ERR(device))
+ continue;
platform_devices[i] = device;
snd_mpu401_devices++;
}
@@ -267,14 +265,10 @@ static int __init alsa_card_mpu401_init(
#ifdef MODULE
printk(KERN_ERR "MPU-401 device not found or device busy\n");
#endif
- err = -ENODEV;
- goto errout;
+ snd_mpu401_unregister_all();
+ return -ENODEV;
}
return 0;
-
- errout:
- snd_mpu401_unregister_all();
- return err;
}
static void __exit alsa_card_mpu401_exit(void)
Index: mm/sound/drivers/serial-u16550.c
===================================================================
--- mm.orig/sound/drivers/serial-u16550.c 2006-04-13 01:36:54.000000000 +0200
+++ mm/sound/drivers/serial-u16550.c 2006-04-13 01:37:40.000000000 +0200
@@ -996,10 +996,8 @@ static int __init alsa_card_serial_init(
continue;
device = platform_device_register_simple(SND_SERIAL_DRIVER,
i, NULL, 0);
- if (IS_ERR(device)) {
- err = PTR_ERR(device);
- goto errout;
- }
+ if (IS_ERR(device))
+ continue;
devices[i] = device;
cards++;
}
@@ -1007,14 +1005,10 @@ static int __init alsa_card_serial_init(
#ifdef MODULE
printk(KERN_ERR "serial midi soundcard not found or device busy\n");
#endif
- err = -ENODEV;
- goto errout;
+ snd_serial_unregister_all();
+ return -ENODEV;
}
return 0;
-
- errout:
- snd_serial_unregister_all();
- return err;
}
static void __exit alsa_card_serial_exit(void)
Index: mm/sound/drivers/virmidi.c
===================================================================
--- mm.orig/sound/drivers/virmidi.c 2006-04-13 01:36:54.000000000 +0200
+++ mm/sound/drivers/virmidi.c 2006-04-13 01:37:40.000000000 +0200
@@ -169,10 +169,8 @@ static int __init alsa_card_virmidi_init
continue;
device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
i, NULL, 0);
- if (IS_ERR(device)) {
- err = PTR_ERR(device);
- goto errout;
- }
+ if (IS_ERR(device))
+ continue;
devices[i] = device;
cards++;
}
@@ -180,14 +178,10 @@ static int __init alsa_card_virmidi_init
#ifdef MODULE
printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n");
#endif
- err = -ENODEV;
- goto errout;
+ snd_virmidi_unregister_all();
+ return -ENODEV;
}
return 0;
-
- errout:
- snd_virmidi_unregister_all();
- return err;
}
static void __exit alsa_card_virmidi_exit(void)
Index: mm/sound/drivers/dummy.c
===================================================================
--- mm.orig/sound/drivers/dummy.c 2006-04-13 01:36:54.000000000 +0200
+++ mm/sound/drivers/dummy.c 2006-04-13 01:39:12.000000000 +0200
@@ -675,10 +675,8 @@ static int __init alsa_card_dummy_init(v
continue;
device = platform_device_register_simple(SND_DUMMY_DRIVER,
i, NULL, 0);
- if (IS_ERR(device)) {
- err = PTR_ERR(device);
- goto errout;
- }
+ if (IS_ERR(device))
+ continue;
devices[i] = device;
cards++;
}
@@ -686,14 +684,10 @@ static int __init alsa_card_dummy_init(v
#ifdef MODULE
printk(KERN_ERR "Dummy soundcard not found or device busy\n");
#endif
- err = -ENODEV;
- goto errout;
+ snd_dummy_unregister_all();
+ return -ENODEV;
}
return 0;
-
- errout:
- snd_dummy_unregister_all();
- return err;
}
static void __exit alsa_card_dummy_exit(void)
next reply other threads:[~2006-04-13 1:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-13 1:41 Rene Herman [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-04-13 1:41 [ALSA 1/2] a few more -- continue on IS_ERR from platform device registration Rene Herman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=443DAC54.5010801@keyaccess.nl \
--to=rene.herman@keyaccess.nl \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.