diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-12-12 17:25:57 +0100 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-12-12 21:40:16 +0100 |
commit | 15c9a0acc3f7873db4b7d35d016729b2dc229b49 (patch) | |
tree | cfd9d6dd645d8116709521001e90dd75ffc19992 /include/asm-generic/gpio.h | |
parent | gpio/powerpc: Eliminate duplication of of_get_named_gpio_flags() (diff) | |
download | linux-15c9a0acc3f7873db4b7d35d016729b2dc229b49.tar.xz linux-15c9a0acc3f7873db4b7d35d016729b2dc229b49.zip |
of: create of_phandle_args to simplify return of phandle parsing data
of_parse_phandle_with_args() needs to return quite a bit of data. Rather
than making each datum a separate **out_ argument, this patch creates
struct of_phandle_args to contain all the returned data and reworks the
user of the function. This patch also enables of_parse_phandle_with_args()
to return the device node pointer for the phandle node.
This patch also ends up being fairly major surgery to
of_parse_handle_with_args(). The existing structure didn't work well
when extending to use of_phandle_args, and I discovered bugs during testing.
I also took the opportunity to rename the function to be like the
existing of_parse_phandle().
v2: - moved declaration of of_phandle_args to fix compile on non-DT builds
- fixed incorrect index in example usage
- fixed incorrect return code handling for empty entries
Reviewed-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/asm-generic/gpio.h')
-rw-r--r-- | include/asm-generic/gpio.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 6b10bdc105d6..d466c8d8826d 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h @@ -4,6 +4,7 @@ #include <linux/kernel.h> #include <linux/types.h> #include <linux/errno.h> +#include <linux/of.h> #ifdef CONFIG_GPIOLIB @@ -128,8 +129,8 @@ struct gpio_chip { */ struct device_node *of_node; int of_gpio_n_cells; - int (*of_xlate)(struct gpio_chip *gc, struct device_node *np, - const void *gpio_spec, u32 *flags); + int (*of_xlate)(struct gpio_chip *gc, + const struct of_phandle_args *gpiospec, u32 *flags); #endif }; |