Skip to content

Commit

Permalink
[ALSA] continue on IS_ERR from platform device registration
Browse files Browse the repository at this point in the history
Continue with the next one on error from device registration.

This would seem the correct thing to do, even if it's not the probe()
error that we're getting.

Signed-off-by: Rene Herman <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Rene Herman authored and Jaroslav Kysela committed Apr 12, 2006
1 parent 12831c1 commit d0ac642
Show file tree
Hide file tree
Showing 16 changed files with 64 additions and 160 deletions.
14 changes: 4 additions & 10 deletions sound/isa/ad1848/ad1848.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,25 +193,19 @@ static int __init alsa_card_ad1848_init(void)
continue;
device = platform_device_register_simple(SND_AD1848_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "AD1848 soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_ad1848_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_ad1848_unregister_all();
return err;
}

static void __exit alsa_card_ad1848_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/cmi8330.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,10 +699,8 @@ static int __init alsa_card_cmi8330_init(void)
continue;
device = platform_device_register_simple(CMI8330_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
platform_devices[i] = device;
cards++;
}
Expand All @@ -719,14 +717,10 @@ static int __init alsa_card_cmi8330_init(void)
#ifdef MODULE
snd_printk(KERN_ERR "CMI8330 not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_cmi8330_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_cmi8330_unregister_all();
return err;
}

static void __exit alsa_card_cmi8330_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/cs423x/cs4231.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,25 +209,19 @@ static int __init alsa_card_cs4231_init(void)
continue;
device = platform_device_register_simple(SND_CS4231_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "CS4231 soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_cs4231_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_cs4231_unregister_all();
return err;
}

static void __exit alsa_card_cs4231_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/cs423x/cs4236.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,8 @@ static int __init alsa_card_cs423x_init(void)
continue;
device = platform_device_register_simple(CS423X_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
platform_devices[i] = device;
snd_cs423x_devices++;
}
Expand All @@ -802,14 +800,10 @@ static int __init alsa_card_cs423x_init(void)
#ifdef MODULE
printk(KERN_ERR IDENT " soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_cs423x_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_cs423x_unregister_all();
return err;
}

static void __exit alsa_card_cs423x_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/es1688/es1688.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,25 +213,19 @@ static int __init alsa_card_es1688_init(void)
continue;
device = platform_device_register_simple(ES1688_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_es1688_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_es1688_unregister_all();
return err;
}

static void __exit alsa_card_es1688_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/es18xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2391,10 +2391,8 @@ static int __init alsa_card_es18xx_init(void)
continue;
device = platform_device_register_simple(ES18XX_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
platform_devices[i] = device;
cards++;
}
Expand All @@ -2411,14 +2409,10 @@ static int __init alsa_card_es18xx_init(void)
#ifdef MODULE
snd_printk(KERN_ERR "ESS AudioDrive ES18xx soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_es18xx_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_es18xx_unregister_all();
return err;
}

static void __exit alsa_card_es18xx_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/gus/gusclassic.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,25 +253,19 @@ static int __init alsa_card_gusclassic_init(void)
continue;
device = platform_device_register_simple(GUSCLASSIC_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "GUS Classic soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_gusclassic_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_gusclassic_unregister_all();
return err;
}

static void __exit alsa_card_gusclassic_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/gus/gusextreme.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,25 +363,19 @@ static int __init alsa_card_gusextreme_init(void)
continue;
device = platform_device_register_simple(GUSEXTREME_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_gusextreme_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_gusextreme_unregister_all();
return err;
}

static void __exit alsa_card_gusextreme_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/gus/gusmax.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,25 +390,19 @@ static int __init alsa_card_gusmax_init(void)
continue;
device = platform_device_register_simple(GUSMAX_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
printk(KERN_ERR "GUS MAX soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_gusmax_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_gusmax_unregister_all();
return err;
}

static void __exit alsa_card_gusmax_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/gus/interwave.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,10 +947,8 @@ static int __init alsa_card_interwave_init(void)
#endif
device = platform_device_register_simple(INTERWAVE_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
platform_devices[i] = device;
cards++;
}
Expand All @@ -966,14 +964,10 @@ static int __init alsa_card_interwave_init(void)
#ifdef MODULE
printk(KERN_ERR "InterWave soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_interwave_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_interwave_unregister_all();
return err;
}

static void __exit alsa_card_interwave_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/opl3sa2.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,8 @@ static int __init alsa_card_opl3sa2_init(void)
#endif
device = platform_device_register_simple(OPL3SA2_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
platform_devices[i] = device;
snd_opl3sa2_devices++;
}
Expand All @@ -983,14 +981,10 @@ static int __init alsa_card_opl3sa2_init(void)
#ifdef MODULE
snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_opl3sa2_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_opl3sa2_unregister_all();
return err;
}

static void __exit alsa_card_opl3sa2_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/sb/sb16.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,8 @@ static int __init alsa_card_sb16_init(void)
continue;
device = platform_device_register_simple(SND_SB16_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
platform_devices[i] = device;
cards++;
}
Expand All @@ -745,14 +743,10 @@ static int __init alsa_card_sb16_init(void)
snd_printk(KERN_ERR "In case, if you have AWE card, try snd-sbawe module\n");
#endif
#endif
err = -ENODEV;
goto errout;
snd_sb16_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_sb16_unregister_all();
return err;
}

static void __exit alsa_card_sb16_exit(void)
Expand Down
14 changes: 4 additions & 10 deletions sound/isa/sb/sb8.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,25 +264,19 @@ static int __init alsa_card_sb8_init(void)
continue;
device = platform_device_register_simple(SND_SB8_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
err = PTR_ERR(device);
goto errout;
}
if (IS_ERR(device))
continue;
devices[i] = device;
cards++;
}
if (!cards) {
#ifdef MODULE
snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n");
#endif
err = -ENODEV;
goto errout;
snd_sb8_unregister_all();
return -ENODEV;
}
return 0;

errout:
snd_sb8_unregister_all();
return err;
}

static void __exit alsa_card_sb8_exit(void)
Expand Down
Loading

0 comments on commit d0ac642

Please sign in to comment.