Messages in this thread | | | Date | Mon, 10 Sep 2012 06:20:52 -0700 | Subject | Re: [PATCH 19/19] gpio: Enable the tc3298x GPIO expander driver for Device Tree | From | Linus Walleij <> |
| |
On Fri, Sep 7, 2012 at 1:14 PM, Lee Jones <lee.jones@linaro.org> wrote:
> Here we provide a means to probe and extract vital information > from Device Tree when booting with it enabled. Without this > patch sub-devices wouldn't be able to reference the tc3589x-gpio > expander from Device Tree. > > CC: Grant Likely <grant.likely@secretlab.ca> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
Basically this looks very good, but:
> @@ -337,9 +343,11 @@ static int __devinit tc3589x_gpio_probe(struct platform_device *pdev) > tc3589x_gpio->chip = template_chip; > tc3589x_gpio->chip.ngpio = tc3589x->num_gpio; > tc3589x_gpio->chip.dev = &pdev->dev; > - tc3589x_gpio->chip.base = pdata->gpio_base; > + tc3589x_gpio->chip.base = (pdata) ? pdata->gpio_base : -1; > > - tc3589x_gpio->irq_base = tc3589x->irq_base + TC3589x_INT_GPIO(0); > +#ifdef CONFIG_OF_GPIO > + tc3589x_gpio->chip.of_node = np; > +#endif
Isn't the newstyle way of doing this something like:
if (IS_ENABLED(CONFIG_OF_GPIO)) tc3589x_gpio->chip.of_node = np;
I'm a bit uncertain about this since I never quite used it myself, test it with OF disabled and see if it works.
This construct also accepts modules using OF, see include/linux/kconfig.h, somebody might be using this as a module.
Yours, Linus Walleij
| |