aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2006-07-25 10:14:16 -0400
committerJaroslav Kysela <perex@suse.cz>2006-08-03 09:21:24 -0400
commit545b07d3620c9eac3349398b5303d20cab260ff6 (patch)
tree1cf62e553bfec0d0b961c0fda9eaa659b8f02af3
parent6e8331ac6973435b1e7604c30f2ad394035b46e1 (diff)
[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 <johannes@sipsolutions.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/ppc/powermac.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/sound/ppc/powermac.c b/sound/ppc/powermac.c
index fa9a44ab487e..2264574fa06b 100644
--- a/sound/ppc/powermac.c
+++ b/sound/ppc/powermac.c
@@ -181,21 +181,14 @@ static int __init alsa_card_pmac_init(void)
181 if ((err = platform_driver_register(&snd_pmac_driver)) < 0) 181 if ((err = platform_driver_register(&snd_pmac_driver)) < 0)
182 return err; 182 return err;
183 device = platform_device_register_simple(SND_PMAC_DRIVER, -1, NULL, 0); 183 device = platform_device_register_simple(SND_PMAC_DRIVER, -1, NULL, 0);
184 if (!IS_ERR(device)) { 184 return 0;
185 if (platform_get_drvdata(device))
186 return 0;
187 platform_device_unregister(device);
188 err = -ENODEV;
189 } else
190 err = PTR_ERR(device);
191 platform_driver_unregister(&snd_pmac_driver);
192 return err;
193 185
194} 186}
195 187
196static void __exit alsa_card_pmac_exit(void) 188static void __exit alsa_card_pmac_exit(void)
197{ 189{
198 platform_device_unregister(device); 190 if (!IS_ERR(device))
191 platform_device_unregister(device);
199 platform_driver_unregister(&snd_pmac_driver); 192 platform_driver_unregister(&snd_pmac_driver);
200} 193}
201 194