Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[firefly-linux-kernel-4.4.55.git] / sound / pci / riptide / riptide.c
index a1521047e6192b13c85d6183992aaacf1b93abab..94639d6b5fb5a3cb19031afbe0dc4432f33dcfe7 100644 (file)
@@ -99,7 +99,7 @@
 #include <linux/firmware.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <asm/io.h>
+#include <linux/io.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/control.h>
@@ -2011,32 +2011,43 @@ snd_riptide_joystick_probe(struct pci_dev *pci, const struct pci_device_id *id)
 {
        static int dev;
        struct gameport *gameport;
+       int ret;
 
        if (dev >= SNDRV_CARDS)
                return -ENODEV;
+
        if (!enable[dev]) {
-               dev++;
-               return -ENOENT;
+               ret = -ENOENT;
+               goto inc_dev;
        }
 
-       if (!joystick_port[dev++])
-               return 0;
+       if (!joystick_port[dev]) {
+               ret = 0;
+               goto inc_dev;
+       }
 
        gameport = gameport_allocate_port();
-       if (!gameport)
-               return -ENOMEM;
+       if (!gameport) {
+               ret = -ENOMEM;
+               goto inc_dev;
+       }
        if (!request_region(joystick_port[dev], 8, "Riptide gameport")) {
                snd_printk(KERN_WARNING
                           "Riptide: cannot grab gameport 0x%x\n",
                           joystick_port[dev]);
                gameport_free_port(gameport);
-               return -EBUSY;
+               ret = -EBUSY;
+               goto inc_dev;
        }
 
        gameport->io = joystick_port[dev];
        gameport_register_port(gameport);
        pci_set_drvdata(pci, gameport);
-       return 0;
+
+       ret = 0;
+inc_dev:
+       dev++;
+       return ret;
 }
 
 static void snd_riptide_joystick_remove(struct pci_dev *pci)