diff --git a/[refs] b/[refs] index 151241add109..b85d15d63d2d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dcccdd938ef0c5d96145957217b814b14bd46cdc +refs/heads/master: f6596f9d2b4f0255f6cd68c76b85fe4cec6352af diff --git a/trunk/include/sound/pcm.h b/trunk/include/sound/pcm.h index df70e7592ab5..66b1f08b42b9 100644 --- a/trunk/include/sound/pcm.h +++ b/trunk/include/sound/pcm.h @@ -367,7 +367,7 @@ struct snd_pcm_substream { struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */ struct snd_pcm_group *group; /* pointer to current group */ /* -- assigned files -- */ - void *file; + struct snd_pcm_file *file; struct file *ffile; void (*pcm_release)(struct snd_pcm_substream *); #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) @@ -898,6 +898,7 @@ ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); +const char *snd_pcm_format_name(snd_pcm_format_t format); void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); void snd_pcm_set_sync(struct snd_pcm_substream *substream); diff --git a/trunk/net/ipv6/reassembly.c b/trunk/net/ipv6/reassembly.c index b67a45fb93e9..eef985e010ea 100644 --- a/trunk/net/ipv6/reassembly.c +++ b/trunk/net/ipv6/reassembly.c @@ -121,6 +121,10 @@ static __inline__ void fq_unlink(struct frag_queue *fq) write_unlock(&ip6_frag_lock); } +/* + * callers should be careful not to use the hash value outside the ipfrag_lock + * as doing so could race with ipfrag_hash_rnd being recalculated. + */ static unsigned int ip6qhashfn(u32 id, struct in6_addr *saddr, struct in6_addr *daddr) { @@ -324,15 +328,16 @@ static void ip6_frag_expire(unsigned long data) /* Creation primitives. */ -static struct frag_queue *ip6_frag_intern(unsigned int hash, - struct frag_queue *fq_in) +static struct frag_queue *ip6_frag_intern(struct frag_queue *fq_in) { struct frag_queue *fq; + unsigned int hash; #ifdef CONFIG_SMP struct hlist_node *n; #endif write_lock(&ip6_frag_lock); + hash = ip6qhashfn(fq_in->id, &fq_in->saddr, &fq_in->daddr); #ifdef CONFIG_SMP hlist_for_each_entry(fq, n, &ip6_frag_hash[hash], list) { if (fq->id == fq_in->id && @@ -362,7 +367,7 @@ static struct frag_queue *ip6_frag_intern(unsigned int hash, static struct frag_queue * -ip6_frag_create(unsigned int hash, u32 id, struct in6_addr *src, struct in6_addr *dst) +ip6_frag_create(u32 id, struct in6_addr *src, struct in6_addr *dst) { struct frag_queue *fq; @@ -379,7 +384,7 @@ ip6_frag_create(unsigned int hash, u32 id, struct in6_addr *src, struct in6_addr spin_lock_init(&fq->lock); atomic_set(&fq->refcnt, 1); - return ip6_frag_intern(hash, fq); + return ip6_frag_intern(fq); oom: IP6_INC_STATS_BH(IPSTATS_MIB_REASMFAILS); @@ -391,9 +396,10 @@ fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst) { struct frag_queue *fq; struct hlist_node *n; - unsigned int hash = ip6qhashfn(id, src, dst); + unsigned int hash; read_lock(&ip6_frag_lock); + hash = ip6qhashfn(id, src, dst); hlist_for_each_entry(fq, n, &ip6_frag_hash[hash], list) { if (fq->id == id && ipv6_addr_equal(src, &fq->saddr) && @@ -405,7 +411,7 @@ fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst) } read_unlock(&ip6_frag_lock); - return ip6_frag_create(hash, id, src, dst); + return ip6_frag_create(id, src, dst); } diff --git a/trunk/sound/core/oss/pcm_oss.c b/trunk/sound/core/oss/pcm_oss.c index c5978d6c6080..91114c7aeff5 100644 --- a/trunk/sound/core/oss/pcm_oss.c +++ b/trunk/sound/core/oss/pcm_oss.c @@ -1682,7 +1682,7 @@ static void snd_pcm_oss_init_substream(struct snd_pcm_substream *substream, substream->oss.setup = *setup; if (setup->nonblock) substream->ffile->f_flags |= O_NONBLOCK; - else if (setup->block) + else substream->ffile->f_flags &= ~O_NONBLOCK; runtime = substream->runtime; runtime->oss.params = 1; @@ -1757,11 +1757,10 @@ static int snd_pcm_oss_open_file(struct file *file, } pcm_oss_file->streams[idx] = substream; - substream->file = pcm_oss_file; snd_pcm_oss_init_substream(substream, &setup[idx], minor); } - if (!pcm_oss_file->streams[0] && !pcm_oss_file->streams[1]) { + if (! pcm_oss_file->streams[0] && pcm_oss_file->streams[1]) { snd_pcm_oss_release_file(pcm_oss_file); return -EINVAL; } @@ -1810,7 +1809,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) err = -EFAULT; goto __error; } - memset(setup, 0, sizeof(setup)); + memset(setup, 0, sizeof(*setup)); if (file->f_mode & FMODE_WRITE) snd_pcm_oss_look_for_setup(pcm, SNDRV_PCM_STREAM_PLAYBACK, task_name, &setup[0]); diff --git a/trunk/sound/core/pcm.c b/trunk/sound/core/pcm.c index 122e10a61ab9..5d7eb123b999 100644 --- a/trunk/sound/core/pcm.c +++ b/trunk/sound/core/pcm.c @@ -196,7 +196,7 @@ static char *snd_pcm_format_names[] = { FORMAT(U18_3BE), }; -static const char *snd_pcm_format_name(snd_pcm_format_t format) +const char *snd_pcm_format_name(snd_pcm_format_t format) { return snd_pcm_format_names[format]; } diff --git a/trunk/sound/core/pcm_native.c b/trunk/sound/core/pcm_native.c index 0860c5a84502..964e4c47a7f1 100644 --- a/trunk/sound/core/pcm_native.c +++ b/trunk/sound/core/pcm_native.c @@ -2007,16 +2007,14 @@ static void pcm_release_private(struct snd_pcm_substream *substream) void snd_pcm_release_substream(struct snd_pcm_substream *substream) { snd_pcm_drop(substream); + if (substream->pcm_release) + substream->pcm_release(substream); if (substream->hw_opened) { if (substream->ops->hw_free != NULL) substream->ops->hw_free(substream); substream->ops->close(substream); substream->hw_opened = 0; } - if (substream->pcm_release) { - substream->pcm_release(substream); - substream->pcm_release = NULL; - } snd_pcm_detach_substream(substream); } diff --git a/trunk/sound/isa/ad1848/ad1848.c b/trunk/sound/isa/ad1848/ad1848.c index 99908e44124d..326a057f752f 100644 --- a/trunk/sound/isa/ad1848/ad1848.c +++ b/trunk/sound/isa/ad1848/ad1848.c @@ -193,11 +193,9 @@ static int __init alsa_card_ad1848_init(void) continue; device = platform_device_register_simple(SND_AD1848_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } devices[i] = device; cards++; @@ -206,10 +204,14 @@ static int __init alsa_card_ad1848_init(void) #ifdef MODULE printk(KERN_ERR "AD1848 soundcard not found or device busy\n"); #endif - snd_ad1848_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_ad1848_unregister_all(); + return err; } static void __exit alsa_card_ad1848_exit(void) diff --git a/trunk/sound/isa/adlib.c b/trunk/sound/isa/adlib.c index 1124344ed948..a253a14e6a45 100644 --- a/trunk/sound/isa/adlib.c +++ b/trunk/sound/isa/adlib.c @@ -43,7 +43,8 @@ static int __devinit snd_adlib_probe(struct platform_device *device) struct snd_card *card; struct snd_opl3 *opl3; - int error, i = device->id; + int error; + int i = device->id; if (port[i] == SNDRV_AUTO_PORT) { snd_printk(KERN_ERR DRV_NAME ": please specify port\n"); @@ -94,7 +95,8 @@ static int __devinit snd_adlib_probe(struct platform_device *device) return 0; out1: snd_card_free(card); -out0: return error; + out0: error = -EINVAL; /* FIXME: should be the original error code */ + return error; } static int __devexit snd_adlib_remove(struct platform_device *device) @@ -132,11 +134,6 @@ static int __init alsa_card_adlib_init(void) if (IS_ERR(device)) continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; - } - devices[i] = device; cards++; } diff --git a/trunk/sound/isa/cmi8330.c b/trunk/sound/isa/cmi8330.c index 3c1e9fd56fe0..bc0f5ebf5d3c 100644 --- a/trunk/sound/isa/cmi8330.c +++ b/trunk/sound/isa/cmi8330.c @@ -699,11 +699,9 @@ static int __init alsa_card_cmi8330_init(void) continue; device = platform_device_register_simple(CMI8330_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } platform_devices[i] = device; cards++; @@ -721,10 +719,14 @@ static int __init alsa_card_cmi8330_init(void) #ifdef MODULE snd_printk(KERN_ERR "CMI8330 not found or device busy\n"); #endif - snd_cmi8330_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_cmi8330_unregister_all(); + return err; } static void __exit alsa_card_cmi8330_exit(void) diff --git a/trunk/sound/isa/cs423x/cs4231.c b/trunk/sound/isa/cs423x/cs4231.c index 397310f358b7..a30dcd962525 100644 --- a/trunk/sound/isa/cs423x/cs4231.c +++ b/trunk/sound/isa/cs423x/cs4231.c @@ -209,11 +209,9 @@ static int __init alsa_card_cs4231_init(void) continue; device = platform_device_register_simple(SND_CS4231_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } devices[i] = device; cards++; @@ -222,10 +220,14 @@ static int __init alsa_card_cs4231_init(void) #ifdef MODULE printk(KERN_ERR "CS4231 soundcard not found or device busy\n"); #endif - snd_cs4231_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_cs4231_unregister_all(); + return err; } static void __exit alsa_card_cs4231_exit(void) diff --git a/trunk/sound/isa/cs423x/cs4236.c b/trunk/sound/isa/cs423x/cs4236.c index f7fa779347ff..382bb17ef49f 100644 --- a/trunk/sound/isa/cs423x/cs4236.c +++ b/trunk/sound/isa/cs423x/cs4236.c @@ -780,11 +780,9 @@ static int __init alsa_card_cs423x_init(void) continue; device = platform_device_register_simple(CS423X_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } platform_devices[i] = device; snd_cs423x_devices++; @@ -804,10 +802,14 @@ static int __init alsa_card_cs423x_init(void) #ifdef MODULE printk(KERN_ERR IDENT " soundcard not found or device busy\n"); #endif - snd_cs423x_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_cs423x_unregister_all(); + return err; } static void __exit alsa_card_cs423x_exit(void) diff --git a/trunk/sound/isa/es1688/es1688.c b/trunk/sound/isa/es1688/es1688.c index e90689ee162f..2b69fc829265 100644 --- a/trunk/sound/isa/es1688/es1688.c +++ b/trunk/sound/isa/es1688/es1688.c @@ -213,11 +213,9 @@ static int __init alsa_card_es1688_init(void) continue; device = platform_device_register_simple(ES1688_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } devices[i] = device; cards++; @@ -226,10 +224,14 @@ static int __init alsa_card_es1688_init(void) #ifdef MODULE printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n"); #endif - snd_es1688_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_es1688_unregister_all(); + return err; } static void __exit alsa_card_es1688_exit(void) diff --git a/trunk/sound/isa/es18xx.c b/trunk/sound/isa/es18xx.c index a36ec1daa5cb..9fbc185b4cc2 100644 --- a/trunk/sound/isa/es18xx.c +++ b/trunk/sound/isa/es18xx.c @@ -2391,11 +2391,9 @@ static int __init alsa_card_es18xx_init(void) continue; device = platform_device_register_simple(ES18XX_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } platform_devices[i] = device; cards++; @@ -2413,10 +2411,14 @@ 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 - snd_es18xx_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_es18xx_unregister_all(); + return err; } static void __exit alsa_card_es18xx_exit(void) diff --git a/trunk/sound/isa/gus/gusclassic.c b/trunk/sound/isa/gus/gusclassic.c index 37057a37dc30..26dccfea2437 100644 --- a/trunk/sound/isa/gus/gusclassic.c +++ b/trunk/sound/isa/gus/gusclassic.c @@ -253,11 +253,9 @@ static int __init alsa_card_gusclassic_init(void) continue; device = platform_device_register_simple(GUSCLASSIC_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } devices[i] = device; cards++; @@ -266,10 +264,14 @@ static int __init alsa_card_gusclassic_init(void) #ifdef MODULE printk(KERN_ERR "GUS Classic soundcard not found or device busy\n"); #endif - snd_gusclassic_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_gusclassic_unregister_all(); + return err; } static void __exit alsa_card_gusclassic_exit(void) diff --git a/trunk/sound/isa/gus/gusextreme.c b/trunk/sound/isa/gus/gusextreme.c index 05852fcc613b..31dc20501d0c 100644 --- a/trunk/sound/isa/gus/gusextreme.c +++ b/trunk/sound/isa/gus/gusextreme.c @@ -363,11 +363,9 @@ static int __init alsa_card_gusextreme_init(void) continue; device = platform_device_register_simple(GUSEXTREME_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } devices[i] = device; cards++; @@ -376,10 +374,14 @@ static int __init alsa_card_gusextreme_init(void) #ifdef MODULE printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n"); #endif - snd_gusextreme_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_gusextreme_unregister_all(); + return err; } static void __exit alsa_card_gusextreme_exit(void) diff --git a/trunk/sound/isa/gus/gusmax.c b/trunk/sound/isa/gus/gusmax.c index fcf2c8fe6f94..cafb9b67fa72 100644 --- a/trunk/sound/isa/gus/gusmax.c +++ b/trunk/sound/isa/gus/gusmax.c @@ -390,11 +390,9 @@ static int __init alsa_card_gusmax_init(void) continue; device = platform_device_register_simple(GUSMAX_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } devices[i] = device; cards++; @@ -403,10 +401,14 @@ static int __init alsa_card_gusmax_init(void) #ifdef MODULE printk(KERN_ERR "GUS MAX soundcard not found or device busy\n"); #endif - snd_gusmax_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_gusmax_unregister_all(); + return err; } static void __exit alsa_card_gusmax_exit(void) diff --git a/trunk/sound/isa/gus/interwave.c b/trunk/sound/isa/gus/interwave.c index 4298d339e786..de71b7a99c83 100644 --- a/trunk/sound/isa/gus/interwave.c +++ b/trunk/sound/isa/gus/interwave.c @@ -947,11 +947,9 @@ static int __init alsa_card_interwave_init(void) #endif device = platform_device_register_simple(INTERWAVE_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } platform_devices[i] = device; cards++; @@ -968,10 +966,14 @@ static int __init alsa_card_interwave_init(void) #ifdef MODULE printk(KERN_ERR "InterWave soundcard not found or device busy\n"); #endif - snd_interwave_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_interwave_unregister_all(); + return err; } static void __exit alsa_card_interwave_exit(void) diff --git a/trunk/sound/isa/opl3sa2.c b/trunk/sound/isa/opl3sa2.c index 6d889052c32c..c906e205d7d5 100644 --- a/trunk/sound/isa/opl3sa2.c +++ b/trunk/sound/isa/opl3sa2.c @@ -962,11 +962,9 @@ static int __init alsa_card_opl3sa2_init(void) #endif device = platform_device_register_simple(OPL3SA2_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } platform_devices[i] = device; snd_opl3sa2_devices++; @@ -985,10 +983,14 @@ 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 - snd_opl3sa2_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_opl3sa2_unregister_all(); + return err; } static void __exit alsa_card_opl3sa2_exit(void) diff --git a/trunk/sound/isa/opti9xx/miro.c b/trunk/sound/isa/opti9xx/miro.c index 83d64bc07ff0..09384d03dc31 100644 --- a/trunk/sound/isa/opti9xx/miro.c +++ b/trunk/sound/isa/opti9xx/miro.c @@ -1436,11 +1436,8 @@ static int __init alsa_card_miro_init(void) if ((error = platform_driver_register(&snd_miro_driver)) < 0) return error; device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0); - if (! IS_ERR(device)) { - if (platform_get_drvdata(device)) - return 0; - platform_device_unregister(device); - } + if (! IS_ERR(device)) + return 0; #ifdef MODULE printk(KERN_ERR "no miro soundcard found\n"); #endif diff --git a/trunk/sound/isa/opti9xx/opti92x-ad1848.c b/trunk/sound/isa/opti9xx/opti92x-ad1848.c index 8ee0d70536f9..65b28cbc0ebd 100644 --- a/trunk/sound/isa/opti9xx/opti92x-ad1848.c +++ b/trunk/sound/isa/opti9xx/opti92x-ad1848.c @@ -2099,11 +2099,8 @@ static int __init alsa_card_opti9xx_init(void) return error; device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0); if (!IS_ERR(device)) { - if (platform_get_drvdata(device)) { - snd_opti9xx_platform_device = device; - return 0; - } - platform_device_unregister(device); + snd_opti9xx_platform_device = device; + return 0; } platform_driver_unregister(&snd_opti9xx_driver); } diff --git a/trunk/sound/isa/sb/sb16.c b/trunk/sound/isa/sb/sb16.c index 6333f900eaee..21ea65925a9e 100644 --- a/trunk/sound/isa/sb/sb16.c +++ b/trunk/sound/isa/sb/sb16.c @@ -720,11 +720,9 @@ static int __init alsa_card_sb16_init(void) continue; device = platform_device_register_simple(SND_SB16_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } platform_devices[i] = device; cards++; @@ -747,10 +745,14 @@ 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 - snd_sb16_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_sb16_unregister_all(); + return err; } static void __exit alsa_card_sb16_exit(void) diff --git a/trunk/sound/isa/sb/sb8.c b/trunk/sound/isa/sb/sb8.c index 141400c01426..3efa23d303c3 100644 --- a/trunk/sound/isa/sb/sb8.c +++ b/trunk/sound/isa/sb/sb8.c @@ -264,11 +264,9 @@ static int __init alsa_card_sb8_init(void) continue; device = platform_device_register_simple(SND_SB8_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } devices[i] = device; cards++; @@ -277,10 +275,14 @@ static int __init alsa_card_sb8_init(void) #ifdef MODULE snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n"); #endif - snd_sb8_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_sb8_unregister_all(); + return err; } static void __exit alsa_card_sb8_exit(void) diff --git a/trunk/sound/isa/sgalaxy.c b/trunk/sound/isa/sgalaxy.c index 09c8e8c6b5e3..a60e66afbf90 100644 --- a/trunk/sound/isa/sgalaxy.c +++ b/trunk/sound/isa/sgalaxy.c @@ -366,11 +366,9 @@ static int __init alsa_card_sgalaxy_init(void) continue; device = platform_device_register_simple(SND_SGALAXY_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } devices[i] = device; cards++; @@ -379,10 +377,14 @@ static int __init alsa_card_sgalaxy_init(void) #ifdef MODULE snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n"); #endif - snd_sgalaxy_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_sgalaxy_unregister_all(); + return err; } static void __exit alsa_card_sgalaxy_exit(void) diff --git a/trunk/sound/isa/sscape.c b/trunk/sound/isa/sscape.c index d2a856f0fde2..48e5552d3444 100644 --- a/trunk/sound/isa/sscape.c +++ b/trunk/sound/isa/sscape.c @@ -1427,8 +1427,8 @@ static int __init sscape_manual_probe(void) dma[i] == SNDRV_AUTO_DMA) { printk(KERN_INFO "sscape: insufficient parameters, need IO, IRQ, MPU-IRQ and DMA\n"); - sscape_unregister_all(); - return -ENXIO; + ret = -ENXIO; + goto errout; } /* @@ -1436,15 +1436,17 @@ static int __init sscape_manual_probe(void) */ device = platform_device_register_simple(SSCAPE_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + ret = PTR_ERR(device); + goto errout; } platform_devices[i] = device; } return 0; + + errout: + sscape_unregister_all(); + return ret; } static void sscape_exit(void) diff --git a/trunk/sound/isa/wavefront/wavefront.c b/trunk/sound/isa/wavefront/wavefront.c index 7ae86f82c3fa..2f13cd5d4dcb 100644 --- a/trunk/sound/isa/wavefront/wavefront.c +++ b/trunk/sound/isa/wavefront/wavefront.c @@ -722,11 +722,9 @@ static int __init alsa_card_wavefront_init(void) #endif device = platform_device_register_simple(WAVEFRONT_DRIVER, i, NULL, 0); - if (IS_ERR(device)) - continue; - if (!platform_get_drvdata(device)) { - platform_device_unregister(device); - continue; + if (IS_ERR(device)) { + err = PTR_ERR(device); + goto errout; } platform_devices[i] = device; cards++; @@ -744,10 +742,14 @@ static int __init alsa_card_wavefront_init(void) #ifdef MODULE printk (KERN_ERR "No WaveFront cards found or devices busy\n"); #endif - snd_wavefront_unregister_all(); - return -ENODEV; + err = -ENODEV; + goto errout; } return 0; + + errout: + snd_wavefront_unregister_all(); + return err; } static void __exit alsa_card_wavefront_exit(void) diff --git a/trunk/sound/pci/ac97/ac97_codec.c b/trunk/sound/pci/ac97/ac97_codec.c index d05200741ac3..278319bbdea1 100644 --- a/trunk/sound/pci/ac97/ac97_codec.c +++ b/trunk/sound/pci/ac97/ac97_codec.c @@ -160,7 +160,6 @@ static const struct ac97_codec_id snd_ac97_codec_ids[] = { { 0x54584e20, 0xffffffff, "TLC320AD9xC", NULL, NULL }, { 0x56494161, 0xffffffff, "VIA1612A", NULL, NULL }, // modified ICE1232 with S/PDIF { 0x56494170, 0xffffffff, "VIA1617A", patch_vt1617a, NULL }, // modified VT1616 with S/PDIF -{ 0x56494182, 0xffffffff, "VIA1618", NULL, NULL }, { 0x57454301, 0xffffffff, "W83971D", NULL, NULL }, { 0x574d4c00, 0xffffffff, "WM9701A", NULL, NULL }, { 0x574d4C03, 0xffffffff, "WM9703,WM9707,WM9708,WM9717", patch_wolfson03, NULL}, diff --git a/trunk/sound/pci/au88x0/au88x0.h b/trunk/sound/pci/au88x0/au88x0.h index f078b716d2b0..d65ccb1866a0 100644 --- a/trunk/sound/pci/au88x0/au88x0.h +++ b/trunk/sound/pci/au88x0/au88x0.h @@ -19,6 +19,7 @@ #ifdef __KERNEL__ #include +#include #include #include #include @@ -276,14 +277,14 @@ static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en); #endif /* Driver stuff. */ -static int vortex_gameport_register(vortex_t * card); +static int __devinit vortex_gameport_register(vortex_t * card); static void vortex_gameport_unregister(vortex_t * card); #ifndef CHIP_AU8820 -static int vortex_eq_init(vortex_t * vortex); -static int vortex_eq_free(vortex_t * vortex); +static int __devinit vortex_eq_init(vortex_t * vortex); +static int __devexit vortex_eq_free(vortex_t * vortex); #endif /* ALSA stuff. */ -static int snd_vortex_new_pcm(vortex_t * vortex, int idx, int nr); -static int snd_vortex_mixer(vortex_t * vortex); -static int snd_vortex_midi(vortex_t * vortex); +static int __devinit snd_vortex_new_pcm(vortex_t * vortex, int idx, int nr); +static int __devinit snd_vortex_mixer(vortex_t * vortex); +static int __devinit snd_vortex_midi(vortex_t * vortex); #endif diff --git a/trunk/sound/pci/au88x0/au88x0_core.c b/trunk/sound/pci/au88x0/au88x0_core.c index 4347e6abc1d5..9cac02e93b25 100644 --- a/trunk/sound/pci/au88x0/au88x0_core.c +++ b/trunk/sound/pci/au88x0/au88x0_core.c @@ -2658,7 +2658,7 @@ static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode) /* Initialization */ -static int __devinit vortex_core_init(vortex_t * vortex) +static int vortex_core_init(vortex_t * vortex) { printk(KERN_INFO "Vortex: init.... "); diff --git a/trunk/sound/pci/au88x0/au88x0_eq.c b/trunk/sound/pci/au88x0/au88x0_eq.c index 0c86a31c4336..64fbfbbaf816 100644 --- a/trunk/sound/pci/au88x0/au88x0_eq.c +++ b/trunk/sound/pci/au88x0/au88x0_eq.c @@ -885,7 +885,7 @@ static char *EqBandLabels[10] __devinitdata = { }; /* ALSA driver entry points. Init and exit. */ -static int __devinit vortex_eq_init(vortex_t * vortex) +static int vortex_eq_init(vortex_t * vortex) { struct snd_kcontrol *kcontrol; int err, i; diff --git a/trunk/sound/pci/au88x0/au88x0_pcm.c b/trunk/sound/pci/au88x0/au88x0_pcm.c index 7b5baa173859..6a13ca1d545e 100644 --- a/trunk/sound/pci/au88x0/au88x0_pcm.c +++ b/trunk/sound/pci/au88x0/au88x0_pcm.c @@ -506,7 +506,7 @@ static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr) int i; int err, nr_capt; - if ((chip == 0) || (idx < 0) || (idx >= VORTEX_PCM_LAST)) + if ((chip == 0) || (idx < 0) || (idx > VORTEX_PCM_LAST)) return -ENODEV; /* idx indicates which kind of PCM device. ADB, SPDIF, I2S and A3D share the diff --git a/trunk/sound/pci/emu10k1/emu10k1_main.c b/trunk/sound/pci/emu10k1/emu10k1_main.c index 6bfa08436efa..31cb9b48bb59 100644 --- a/trunk/sound/pci/emu10k1/emu10k1_main.c +++ b/trunk/sound/pci/emu10k1/emu10k1_main.c @@ -843,11 +843,8 @@ static struct snd_emu_chip_details emu_chip_details[] = { .spdif_bug = 1, .ac97_chip = 1} , /* Tested by shane-alsa@cm.nu 5th Nov 2005 */ - /* The 0x20061102 does have SB0350 written on it - * Just like 0x20021102 - */ {.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20061102, - .driver = "Audigy2", .name = "Audigy 2 [SB0350b]", + .driver = "Audigy2", .name = "Audigy 2 [2006]", .id = "Audigy2", .emu10k2_chip = 1, .ca0102_chip = 1, diff --git a/trunk/sound/pci/hda/patch_analog.c b/trunk/sound/pci/hda/patch_analog.c index bcfca159c6a2..2bfe37e8543c 100644 --- a/trunk/sound/pci/hda/patch_analog.c +++ b/trunk/sound/pci/hda/patch_analog.c @@ -801,10 +801,6 @@ static struct hda_board_config ad1986a_cfg_tbl[] = { .config = AD1986A_LAPTOP_EAPD }, /* Samsung R65-T2300 Charis */ { .pci_subvendor = 0x1043, .pci_subdevice = 0x1213, .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */ - { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7, - .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */ - { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af, - .config = AD1986A_LAPTOP_EAPD }, /* HP Compaq Presario B2800 */ {} }; @@ -1334,8 +1330,6 @@ static struct hda_board_config ad1981_cfg_tbl[] = { .config = AD1981_HP }, /* HP nx6320 */ { .pci_subvendor = 0x103c, .pci_subdevice = 0x309f, .config = AD1981_HP }, /* HP nx9420 AngelFire */ - { .pci_subvendor = 0x103c, .pci_subdevice = 0x30a2, - .config = AD1981_HP }, /* HP nx9420 AngelFire */ { .modelname = "basic", .config = AD1981_BASIC }, {} }; diff --git a/trunk/sound/pci/hda/patch_sigmatel.c b/trunk/sound/pci/hda/patch_sigmatel.c index 715260787953..abe9493f0a2c 100644 --- a/trunk/sound/pci/hda/patch_sigmatel.c +++ b/trunk/sound/pci/hda/patch_sigmatel.c @@ -310,9 +310,6 @@ static struct hda_board_config stac922x_cfg_tbl[] = { .pci_subdevice = 0x0b0b, .config = STAC_D945GTP3 }, /* Intel D945PSN - 3 Stack, 9221 A1 */ { .pci_subvendor = PCI_VENDOR_ID_INTEL, - .pci_subdevice = 0x0707, - .config = STAC_D945GTP5 }, /* Intel D945PSV - 5 Stack */ - { .pci_subvendor = PCI_VENDOR_ID_INTEL, .pci_subdevice = 0x0404, .config = STAC_D945GTP5 }, /* Intel D945GTP - 5 Stack */ { .pci_subvendor = PCI_VENDOR_ID_INTEL, diff --git a/trunk/sound/pci/via82xx.c b/trunk/sound/pci/via82xx.c index 0f171dd1377b..1e7398de2865 100644 --- a/trunk/sound/pci/via82xx.c +++ b/trunk/sound/pci/via82xx.c @@ -2333,7 +2333,6 @@ static int __devinit check_dxs_list(struct pci_dev *pci) { .subvendor = 0x1019, .subdevice = 0x0a81, .action = VIA_DXS_NO_VRA }, /* ECS K7VTA3 v8.0 */ { .subvendor = 0x1019, .subdevice = 0x0a85, .action = VIA_DXS_NO_VRA }, /* ECS L7VMM2 */ { .subvendor = 0x1019, .subdevice = 0xa101, .action = VIA_DXS_SRC }, - { .subvendor = 0x1019, .subdevice = 0xaa01, .action = VIA_DXS_SRC }, /* ECS K8T890-A */ { .subvendor = 0x1025, .subdevice = 0x0033, .action = VIA_DXS_NO_VRA }, /* Acer Inspire 1353LM */ { .subvendor = 0x1025, .subdevice = 0x0046, .action = VIA_DXS_SRC }, /* Acer Aspire 1524 WLMi */ { .subvendor = 0x1043, .subdevice = 0x8095, .action = VIA_DXS_NO_VRA }, /* ASUS A7V8X (FIXME: possibly VIA_DXS_ENABLE?)*/