lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZ4-_dqoNoCa_vRq04Or-8PjWz-bgHrvsLJFs8pOAE9xQ@mail.gmail.com>
Date:	Mon, 10 Sep 2012 06:20:52 -0700
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Lee Jones <lee.jones@...aro.org>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	STEricsson_nomadik_linux@...t.st.com, linus.walleij@...ricsson.com,
	arnd@...db.de, Grant Likely <grant.likely@...retlab.ca>
Subject: Re: [PATCH 19/19] gpio: Enable the tc3298x GPIO expander driver for
 Device Tree

On Fri, Sep 7, 2012 at 1:14 PM, Lee Jones <lee.jones@...aro.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@...retlab.ca>
> Signed-off-by: Lee Jones <lee.jones@...aro.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ