提交 d0ac642d 编写于 作者: R Rene Herman 提交者: Jaroslav Kysela

[ALSA] continue on IS_ERR from platform device registration

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: NRene Herman <rene.herman@keyaccess.nl>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 12831c15
...@@ -193,10 +193,8 @@ static int __init alsa_card_ad1848_init(void) ...@@ -193,10 +193,8 @@ static int __init alsa_card_ad1848_init(void)
continue; continue;
device = platform_device_register_simple(SND_AD1848_DRIVER, device = platform_device_register_simple(SND_AD1848_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -204,14 +202,10 @@ static int __init alsa_card_ad1848_init(void) ...@@ -204,14 +202,10 @@ static int __init alsa_card_ad1848_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "AD1848 soundcard not found or device busy\n"); printk(KERN_ERR "AD1848 soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_ad1848_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_ad1848_unregister_all();
return err;
} }
static void __exit alsa_card_ad1848_exit(void) static void __exit alsa_card_ad1848_exit(void)
......
...@@ -699,10 +699,8 @@ static int __init alsa_card_cmi8330_init(void) ...@@ -699,10 +699,8 @@ static int __init alsa_card_cmi8330_init(void)
continue; continue;
device = platform_device_register_simple(CMI8330_DRIVER, device = platform_device_register_simple(CMI8330_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
cards++; cards++;
} }
...@@ -719,14 +717,10 @@ static int __init alsa_card_cmi8330_init(void) ...@@ -719,14 +717,10 @@ static int __init alsa_card_cmi8330_init(void)
#ifdef MODULE #ifdef MODULE
snd_printk(KERN_ERR "CMI8330 not found or device busy\n"); snd_printk(KERN_ERR "CMI8330 not found or device busy\n");
#endif #endif
err = -ENODEV; snd_cmi8330_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_cmi8330_unregister_all();
return err;
} }
static void __exit alsa_card_cmi8330_exit(void) static void __exit alsa_card_cmi8330_exit(void)
......
...@@ -209,10 +209,8 @@ static int __init alsa_card_cs4231_init(void) ...@@ -209,10 +209,8 @@ static int __init alsa_card_cs4231_init(void)
continue; continue;
device = platform_device_register_simple(SND_CS4231_DRIVER, device = platform_device_register_simple(SND_CS4231_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -220,14 +218,10 @@ static int __init alsa_card_cs4231_init(void) ...@@ -220,14 +218,10 @@ static int __init alsa_card_cs4231_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "CS4231 soundcard not found or device busy\n"); printk(KERN_ERR "CS4231 soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_cs4231_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_cs4231_unregister_all();
return err;
} }
static void __exit alsa_card_cs4231_exit(void) static void __exit alsa_card_cs4231_exit(void)
......
...@@ -780,10 +780,8 @@ static int __init alsa_card_cs423x_init(void) ...@@ -780,10 +780,8 @@ static int __init alsa_card_cs423x_init(void)
continue; continue;
device = platform_device_register_simple(CS423X_DRIVER, device = platform_device_register_simple(CS423X_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
snd_cs423x_devices++; snd_cs423x_devices++;
} }
...@@ -802,14 +800,10 @@ static int __init alsa_card_cs423x_init(void) ...@@ -802,14 +800,10 @@ static int __init alsa_card_cs423x_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR IDENT " soundcard not found or device busy\n"); printk(KERN_ERR IDENT " soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_cs423x_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_cs423x_unregister_all();
return err;
} }
static void __exit alsa_card_cs423x_exit(void) static void __exit alsa_card_cs423x_exit(void)
......
...@@ -213,10 +213,8 @@ static int __init alsa_card_es1688_init(void) ...@@ -213,10 +213,8 @@ static int __init alsa_card_es1688_init(void)
continue; continue;
device = platform_device_register_simple(ES1688_DRIVER, device = platform_device_register_simple(ES1688_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -224,14 +222,10 @@ static int __init alsa_card_es1688_init(void) ...@@ -224,14 +222,10 @@ static int __init alsa_card_es1688_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n"); printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_es1688_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_es1688_unregister_all();
return err;
} }
static void __exit alsa_card_es1688_exit(void) static void __exit alsa_card_es1688_exit(void)
......
...@@ -2391,10 +2391,8 @@ static int __init alsa_card_es18xx_init(void) ...@@ -2391,10 +2391,8 @@ static int __init alsa_card_es18xx_init(void)
continue; continue;
device = platform_device_register_simple(ES18XX_DRIVER, device = platform_device_register_simple(ES18XX_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
cards++; cards++;
} }
...@@ -2411,14 +2409,10 @@ static int __init alsa_card_es18xx_init(void) ...@@ -2411,14 +2409,10 @@ static int __init alsa_card_es18xx_init(void)
#ifdef MODULE #ifdef MODULE
snd_printk(KERN_ERR "ESS AudioDrive ES18xx soundcard not found or device busy\n"); snd_printk(KERN_ERR "ESS AudioDrive ES18xx soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_es18xx_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_es18xx_unregister_all();
return err;
} }
static void __exit alsa_card_es18xx_exit(void) static void __exit alsa_card_es18xx_exit(void)
......
...@@ -253,10 +253,8 @@ static int __init alsa_card_gusclassic_init(void) ...@@ -253,10 +253,8 @@ static int __init alsa_card_gusclassic_init(void)
continue; continue;
device = platform_device_register_simple(GUSCLASSIC_DRIVER, device = platform_device_register_simple(GUSCLASSIC_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -264,14 +262,10 @@ static int __init alsa_card_gusclassic_init(void) ...@@ -264,14 +262,10 @@ static int __init alsa_card_gusclassic_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "GUS Classic soundcard not found or device busy\n"); printk(KERN_ERR "GUS Classic soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_gusclassic_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_gusclassic_unregister_all();
return err;
} }
static void __exit alsa_card_gusclassic_exit(void) static void __exit alsa_card_gusclassic_exit(void)
......
...@@ -363,10 +363,8 @@ static int __init alsa_card_gusextreme_init(void) ...@@ -363,10 +363,8 @@ static int __init alsa_card_gusextreme_init(void)
continue; continue;
device = platform_device_register_simple(GUSEXTREME_DRIVER, device = platform_device_register_simple(GUSEXTREME_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -374,14 +372,10 @@ static int __init alsa_card_gusextreme_init(void) ...@@ -374,14 +372,10 @@ static int __init alsa_card_gusextreme_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n"); printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_gusextreme_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_gusextreme_unregister_all();
return err;
} }
static void __exit alsa_card_gusextreme_exit(void) static void __exit alsa_card_gusextreme_exit(void)
......
...@@ -390,10 +390,8 @@ static int __init alsa_card_gusmax_init(void) ...@@ -390,10 +390,8 @@ static int __init alsa_card_gusmax_init(void)
continue; continue;
device = platform_device_register_simple(GUSMAX_DRIVER, device = platform_device_register_simple(GUSMAX_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -401,14 +399,10 @@ static int __init alsa_card_gusmax_init(void) ...@@ -401,14 +399,10 @@ static int __init alsa_card_gusmax_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "GUS MAX soundcard not found or device busy\n"); printk(KERN_ERR "GUS MAX soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_gusmax_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_gusmax_unregister_all();
return err;
} }
static void __exit alsa_card_gusmax_exit(void) static void __exit alsa_card_gusmax_exit(void)
......
...@@ -947,10 +947,8 @@ static int __init alsa_card_interwave_init(void) ...@@ -947,10 +947,8 @@ static int __init alsa_card_interwave_init(void)
#endif #endif
device = platform_device_register_simple(INTERWAVE_DRIVER, device = platform_device_register_simple(INTERWAVE_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
cards++; cards++;
} }
...@@ -966,14 +964,10 @@ static int __init alsa_card_interwave_init(void) ...@@ -966,14 +964,10 @@ static int __init alsa_card_interwave_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "InterWave soundcard not found or device busy\n"); printk(KERN_ERR "InterWave soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_interwave_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_interwave_unregister_all();
return err;
} }
static void __exit alsa_card_interwave_exit(void) static void __exit alsa_card_interwave_exit(void)
......
...@@ -962,10 +962,8 @@ static int __init alsa_card_opl3sa2_init(void) ...@@ -962,10 +962,8 @@ static int __init alsa_card_opl3sa2_init(void)
#endif #endif
device = platform_device_register_simple(OPL3SA2_DRIVER, device = platform_device_register_simple(OPL3SA2_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
snd_opl3sa2_devices++; snd_opl3sa2_devices++;
} }
...@@ -983,14 +981,10 @@ static int __init alsa_card_opl3sa2_init(void) ...@@ -983,14 +981,10 @@ static int __init alsa_card_opl3sa2_init(void)
#ifdef MODULE #ifdef MODULE
snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n"); snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_opl3sa2_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_opl3sa2_unregister_all();
return err;
} }
static void __exit alsa_card_opl3sa2_exit(void) static void __exit alsa_card_opl3sa2_exit(void)
......
...@@ -720,10 +720,8 @@ static int __init alsa_card_sb16_init(void) ...@@ -720,10 +720,8 @@ static int __init alsa_card_sb16_init(void)
continue; continue;
device = platform_device_register_simple(SND_SB16_DRIVER, device = platform_device_register_simple(SND_SB16_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
cards++; cards++;
} }
...@@ -745,14 +743,10 @@ static int __init alsa_card_sb16_init(void) ...@@ -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"); snd_printk(KERN_ERR "In case, if you have AWE card, try snd-sbawe module\n");
#endif #endif
#endif #endif
err = -ENODEV; snd_sb16_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_sb16_unregister_all();
return err;
} }
static void __exit alsa_card_sb16_exit(void) static void __exit alsa_card_sb16_exit(void)
......
...@@ -264,10 +264,8 @@ static int __init alsa_card_sb8_init(void) ...@@ -264,10 +264,8 @@ static int __init alsa_card_sb8_init(void)
continue; continue;
device = platform_device_register_simple(SND_SB8_DRIVER, device = platform_device_register_simple(SND_SB8_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -275,14 +273,10 @@ static int __init alsa_card_sb8_init(void) ...@@ -275,14 +273,10 @@ static int __init alsa_card_sb8_init(void)
#ifdef MODULE #ifdef MODULE
snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n"); snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_sb8_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_sb8_unregister_all();
return err;
} }
static void __exit alsa_card_sb8_exit(void) static void __exit alsa_card_sb8_exit(void)
......
...@@ -366,10 +366,8 @@ static int __init alsa_card_sgalaxy_init(void) ...@@ -366,10 +366,8 @@ static int __init alsa_card_sgalaxy_init(void)
continue; continue;
device = platform_device_register_simple(SND_SGALAXY_DRIVER, device = platform_device_register_simple(SND_SGALAXY_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -377,14 +375,10 @@ static int __init alsa_card_sgalaxy_init(void) ...@@ -377,14 +375,10 @@ static int __init alsa_card_sgalaxy_init(void)
#ifdef MODULE #ifdef MODULE
snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n"); snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_sgalaxy_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_sgalaxy_unregister_all();
return err;
} }
static void __exit alsa_card_sgalaxy_exit(void) static void __exit alsa_card_sgalaxy_exit(void)
......
...@@ -1427,8 +1427,8 @@ static int __init sscape_manual_probe(void) ...@@ -1427,8 +1427,8 @@ static int __init sscape_manual_probe(void)
dma[i] == SNDRV_AUTO_DMA) { dma[i] == SNDRV_AUTO_DMA) {
printk(KERN_INFO printk(KERN_INFO
"sscape: insufficient parameters, need IO, IRQ, MPU-IRQ and DMA\n"); "sscape: insufficient parameters, need IO, IRQ, MPU-IRQ and DMA\n");
ret = -ENXIO; sscape_unregister_all();
goto errout; return -ENXIO;
} }
/* /*
...@@ -1436,17 +1436,11 @@ static int __init sscape_manual_probe(void) ...@@ -1436,17 +1436,11 @@ static int __init sscape_manual_probe(void)
*/ */
device = platform_device_register_simple(SSCAPE_DRIVER, device = platform_device_register_simple(SSCAPE_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
ret = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
} }
return 0; return 0;
errout:
sscape_unregister_all();
return ret;
} }
static void sscape_exit(void) static void sscape_exit(void)
......
...@@ -722,10 +722,8 @@ static int __init alsa_card_wavefront_init(void) ...@@ -722,10 +722,8 @@ static int __init alsa_card_wavefront_init(void)
#endif #endif
device = platform_device_register_simple(WAVEFRONT_DRIVER, device = platform_device_register_simple(WAVEFRONT_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
cards++; cards++;
} }
...@@ -742,14 +740,10 @@ static int __init alsa_card_wavefront_init(void) ...@@ -742,14 +740,10 @@ static int __init alsa_card_wavefront_init(void)
#ifdef MODULE #ifdef MODULE
printk (KERN_ERR "No WaveFront cards found or devices busy\n"); printk (KERN_ERR "No WaveFront cards found or devices busy\n");
#endif #endif
err = -ENODEV; snd_wavefront_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_wavefront_unregister_all();
return err;
} }
static void __exit alsa_card_wavefront_exit(void) static void __exit alsa_card_wavefront_exit(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册