OSDN Git Service

gpio: Propagate firmware node from a parent device
[uclinux-h8/linux.git] / drivers / gpio / gpio-tps6586x.c
index da0304b..c571352 100644 (file)
@@ -77,6 +77,8 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
        struct tps6586x_platform_data *pdata;
        struct tps6586x_gpio *tps6586x_gpio;
 
+       device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
+
        pdata = dev_get_platdata(pdev->dev.parent);
        tps6586x_gpio = devm_kzalloc(&pdev->dev,
                                sizeof(*tps6586x_gpio), GFP_KERNEL);
@@ -97,9 +99,6 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
        tps6586x_gpio->gpio_chip.get    = tps6586x_gpio_get;
        tps6586x_gpio->gpio_chip.to_irq = tps6586x_gpio_to_irq;
 
-#ifdef CONFIG_OF_GPIO
-       tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node;
-#endif
        if (pdata && pdata->gpio_base)
                tps6586x_gpio->gpio_chip.base = pdata->gpio_base;
        else