[ALSA] unregister platform device again if probe was unsuccessful
[linux-3.10.git] / sound / drivers / mpu401 / mpu401.c
index 77b0600..d3cbbb0 100644 (file)
@@ -253,6 +253,10 @@ static int __init alsa_card_mpu401_init(void)
                                                         i, NULL, 0);
                if (IS_ERR(device))
                        continue;
+               if (!platform_get_drvdata(device)) {
+                       platform_device_unregister(device);
+                       continue;
+               }
                platform_devices[i] = device;
                snd_mpu401_devices++;
        }