From: Johannes Berg Date: Tue, 25 Jul 2006 14:14:16 +0000 (+0200) Subject: [ALSA] make snd-powermac load even when it can't bind the device X-Git-Tag: v2.6.18-rc4~2^2~4 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=545b07d3620c9eac3349398b5303d20cab260ff6;p=linux-2.6-omap-h63xx.git [ALSA] make snd-powermac load even when it can't bind the device This patch makes snd-powermac load when it can't bind the device right away. That's the expected behaviour for hotplugging, but fixes an important problem I was seeing with doing a modprobe snd-powermac with a version that refuses loading on machines with layout-id: snd-powermac would create a bunch of uevents and then refuse to load, the uevents causing udev to reload it again, ad eternum. Signed-off-by: Johannes Berg Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c index fa9a44ab487..2264574fa06 100644 --- a/sound/ppc/powermac.c +++ b/sound/ppc/powermac.c @@ -181,21 +181,14 @@ static int __init alsa_card_pmac_init(void) if ((err = platform_driver_register(&snd_pmac_driver)) < 0) return err; device = platform_device_register_simple(SND_PMAC_DRIVER, -1, NULL, 0); - if (!IS_ERR(device)) { - if (platform_get_drvdata(device)) - return 0; - platform_device_unregister(device); - err = -ENODEV; - } else - err = PTR_ERR(device); - platform_driver_unregister(&snd_pmac_driver); - return err; + return 0; } static void __exit alsa_card_pmac_exit(void) { - platform_device_unregister(device); + if (!IS_ERR(device)) + platform_device_unregister(device); platform_driver_unregister(&snd_pmac_driver); }