Index: local/sound/isa/adlib.c =================================================================== --- local.orig/sound/isa/adlib.c 2006-04-05 13:41:27.000000000 +0200 +++ local/sound/isa/adlib.c 2006-04-05 14:31:32.000000000 +0200 @@ -38,13 +38,12 @@ static void snd_adlib_free(struct snd_ca release_and_free_resource(card->private_data); } -static int __devinit snd_adlib_probe(struct platform_device *device) +static int __devinit snd_adlib_probe(int i) { struct snd_card *card; struct snd_opl3 *opl3; int error; - int i = device->id; if (port[i] == SNDRV_AUTO_PORT) { snd_printk(KERN_ERR DRV_NAME ": please specify port\n"); @@ -91,12 +90,18 @@ static int __devinit snd_adlib_probe(str goto out1; } - platform_set_drvdata(device, card); + devices[i] = platform_device_register_simple(DRV_NAME, i, NULL, 0); + if (IS_ERR(devices[i])) { + snd_printk(KERN_ERR DRV_NAME ": could not register device\n"); + error = PTR_ERR(devices[i]); + goto out1; + } + + platform_set_drvdata(devices[i], card); return 0; out1: snd_card_free(card); - out0: error = -EINVAL; /* FIXME: should be the original error code */ - return error; +out0: return error; } static int __devexit snd_adlib_remove(struct platform_device *device) @@ -107,9 +112,7 @@ static int __devexit snd_adlib_remove(st } static struct platform_driver snd_adlib_driver = { - .probe = snd_adlib_probe, .remove = __devexit_p(snd_adlib_remove), - .driver = { .name = DRV_NAME } @@ -117,26 +120,17 @@ static struct platform_driver snd_adlib_ static int __init alsa_card_adlib_init(void) { - int i, cards; + int error, cards, i; - if (platform_driver_register(&snd_adlib_driver) < 0) { + error = platform_driver_register(&snd_adlib_driver); + if (error < 0) { snd_printk(KERN_ERR DRV_NAME ": could not register driver\n"); - return -ENODEV; + return error; } - for (cards = 0, i = 0; i < SNDRV_CARDS; i++) { - struct platform_device *device; - - if (!enable[i]) - continue; - - device = platform_device_register_simple(DRV_NAME, i, NULL, 0); - if (IS_ERR(device)) - continue; - - devices[i] = device; - cards++; - } + for (cards = 0, i = 0; i < SNDRV_CARDS; i++) + if (enable[i] && snd_adlib_probe(i) >= 0) + cards++ if (!cards) { #ifdef MODULE