gpio: pch: allow use from device tree
authorPaul Burton <paul.burton@imgtec.com>
Mon, 30 Nov 2015 16:21:38 +0000 (16:21 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 10 Dec 2015 16:24:40 +0000 (17:24 +0100)
Allow GPIOs from the gpio-pch driver to be referenced from device tree
by simply setting the struct gpio_chip of_node pointer to that of the
struct pci_dev.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pch.c

index e43db64e52b39d16bd4ed2dfa6cbb4779cd209d4..a650a6cc1312e7988f538aa4560d214e6bdfba0e 100644 (file)
@@ -394,6 +394,7 @@ static int pch_gpio_probe(struct pci_dev *pdev,
        pci_set_drvdata(pdev, chip);
        spin_lock_init(&chip->spinlock);
        pch_gpio_setup(chip);
+       chip->gpio.of_node = pdev->dev.of_node;
        ret = gpiochip_add(&chip->gpio);
        if (ret) {
                dev_err(&pdev->dev, "PCH gpio: Failed to register GPIO\n");