PATCH Add support for the Iomega IX2-200 Device Tree

Andrew Lunn andrew at
Thu Aug 16 18:10:00 EDT 2012

> the problem seems to be in this comming from this line:
> button->gpio = of_get_gpio_flags(pp, 0, &flags);
> in the function :
> /*
>  * Translate OpenFirmware node properties into platform_data
>  */
> static struct gpio_keys_platform_data * __devinit
> of the gpio_keys.c file or whatever that line links to. It does not
> know how to deal with some NULL reference as far as i can tell.

Do you mean this piece of code:

       while ((pp = of_get_next_child(node, pp))) {
                enum of_gpio_flags flags;

                if (!of_find_property(pp, "gpios", NULL)) {
                        dev_warn(dev, "Found button without gpios\n");
                buttons[i].gpio = of_get_gpio_flags(pp, 0, &flags);

This would fit with:

[    5.981782] Unable to handle kernel NULL pointer dereference at
virtual address 00000004
since gpio is at offset 4 in buttons. What is the value of i when it
oppses? What is buttons[i]?


More information about the linux-arm-kernel mailing list