diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/drivers/mpu401/mpu401.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index 9d10d79e27af..9ea3059a7064 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c | |||
@@ -59,7 +59,8 @@ module_param_array(irq, int, NULL, 0444); | |||
59 | MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device."); | 59 | MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device."); |
60 | 60 | ||
61 | static struct platform_device *platform_devices[SNDRV_CARDS]; | 61 | static struct platform_device *platform_devices[SNDRV_CARDS]; |
62 | static int pnp_registered = 0; | 62 | static int pnp_registered; |
63 | static unsigned int snd_mpu401_devices; | ||
63 | 64 | ||
64 | static int snd_mpu401_create(int dev, struct snd_card **rcard) | 65 | static int snd_mpu401_create(int dev, struct snd_card **rcard) |
65 | { | 66 | { |
@@ -197,6 +198,7 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev, | |||
197 | } | 198 | } |
198 | snd_card_set_dev(card, &pnp_dev->dev); | 199 | snd_card_set_dev(card, &pnp_dev->dev); |
199 | pnp_set_drvdata(pnp_dev, card); | 200 | pnp_set_drvdata(pnp_dev, card); |
201 | snd_mpu401_devices++; | ||
200 | ++dev; | 202 | ++dev; |
201 | return 0; | 203 | return 0; |
202 | } | 204 | } |
@@ -234,12 +236,11 @@ static void __init_or_module snd_mpu401_unregister_all(void) | |||
234 | 236 | ||
235 | static int __init alsa_card_mpu401_init(void) | 237 | static int __init alsa_card_mpu401_init(void) |
236 | { | 238 | { |
237 | int i, err, devices; | 239 | int i, err; |
238 | 240 | ||
239 | if ((err = platform_driver_register(&snd_mpu401_driver)) < 0) | 241 | if ((err = platform_driver_register(&snd_mpu401_driver)) < 0) |
240 | return err; | 242 | return err; |
241 | 243 | ||
242 | devices = 0; | ||
243 | for (i = 0; i < SNDRV_CARDS; i++) { | 244 | for (i = 0; i < SNDRV_CARDS; i++) { |
244 | struct platform_device *device; | 245 | struct platform_device *device; |
245 | if (! enable[i]) | 246 | if (! enable[i]) |
@@ -255,14 +256,13 @@ static int __init alsa_card_mpu401_init(void) | |||
255 | goto errout; | 256 | goto errout; |
256 | } | 257 | } |
257 | platform_devices[i] = device; | 258 | platform_devices[i] = device; |
258 | devices++; | 259 | snd_mpu401_devices++; |
259 | } | 260 | } |
260 | if ((err = pnp_register_driver(&snd_mpu401_pnp_driver)) >= 0) { | 261 | err = pnp_register_driver(&snd_mpu401_pnp_driver); |
262 | if (!err) | ||
261 | pnp_registered = 1; | 263 | pnp_registered = 1; |
262 | devices += err; | ||
263 | } | ||
264 | 264 | ||
265 | if (!devices) { | 265 | if (!snd_mpu401_devices) { |
266 | #ifdef MODULE | 266 | #ifdef MODULE |
267 | printk(KERN_ERR "MPU-401 device not found or device busy\n"); | 267 | printk(KERN_ERR "MPU-401 device not found or device busy\n"); |
268 | #endif | 268 | #endif |