gpio-exar/8250-exar: Do not even instantiate a GPIO device for Commtech cards
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 25 May 2017 06:25:19 +0000 (08:25 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Mon, 3 Jul 2017 06:23:09 +0000 (08:23 +0200)
Commtech adapters need the MPIOs for internal purposes, and the
gpio-exar driver already refused to pick them up. But there is actually
no point in even creating the underlying platform device.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpio-exar.c
drivers/tty/serial/8250/8250_exar.c

index 4b46273ca5458c4375358a2621f9106db0705117..139d54008ad0c2790b78abadce219b2ebb975342 100644 (file)
@@ -124,9 +124,6 @@ static int gpio_exar_probe(struct platform_device *pdev)
        void __iomem *p;
        int index, ret;
 
-       if (pcidev->vendor != PCI_VENDOR_ID_EXAR)
-               return -ENODEV;
-
        /*
         * Map the pci device to get the register addresses.
         * We will need to read and write those registers to control
index 2adc0f1a2196f339c121cad9b3b8a2ce891a3203..36877c8ad6522a82d3a2aa0ffb6bd46ddb11bcfe 100644 (file)
@@ -239,7 +239,9 @@ pci_xr17v35x_setup(struct exar8250 *priv, struct pci_dev *pcidev,
                /* Setup Multipurpose Input/Output pins. */
                setup_gpio(p);
 
-               port->port.private_data = xr17v35x_register_gpio(pcidev);
+               if (pcidev->vendor == PCI_VENDOR_ID_EXAR)
+                       port->port.private_data =
+                               xr17v35x_register_gpio(pcidev);
        }
 
        return 0;