Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: wm831x: Add basic device tree support

Now the wm831x-core has basic DT support we can update this driver to
allow use of the GPIOs within a device tree system.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Charles Keepax and committed by
Lee Jones
9674a8dc f6dd8449

+4 -1
+4 -1
drivers/gpio/gpio-wm831x.c
··· 263 263 static int wm831x_gpio_probe(struct platform_device *pdev) 264 264 { 265 265 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); 266 - struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); 266 + struct wm831x_pdata *pdata = &wm831x->pdata; 267 267 struct wm831x_gpio *wm831x_gpio; 268 268 int ret; 269 269 ··· 280 280 wm831x_gpio->gpio_chip.base = pdata->gpio_base; 281 281 else 282 282 wm831x_gpio->gpio_chip.base = -1; 283 + #ifdef CONFIG_OF_GPIO 284 + wm831x_gpio->gpio_chip.of_node = wm831x->dev->of_node; 285 + #endif 283 286 284 287 ret = devm_gpiochip_add_data(&pdev->dev, &wm831x_gpio->gpio_chip, 285 288 wm831x_gpio);