diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-11-22 14:05:46 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-22 14:05:46 -0500 |
commit | 515db09338704a6ad7d27b5f1e33820d3052edd2 (patch) | |
tree | 74f915531710303397d34069b325c2be7a5ac93c /drivers/input/keyboard/gpio_keys.c | |
parent | 30be52e44fd4276d768efffb55d424fb682e6505 (diff) | |
parent | cfcfc9eca2bcbd26a8e206baeb005b055dbf8e37 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Conflicts:
drivers/net/wireless/iwlegacy/iwl-debugfs.c
drivers/net/wireless/iwlegacy/iwl-rx.c
drivers/net/wireless/iwlegacy/iwl-scan.c
drivers/net/wireless/iwlegacy/iwl-tx.c
include/net/bluetooth/bluetooth.h
Diffstat (limited to 'drivers/input/keyboard/gpio_keys.c')
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 67df91af842..ed1ed469d08 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -461,8 +461,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev, struct device_node *node, *pp; int i; struct gpio_keys_button *buttons; - const u32 *reg; - int len; + u32 reg; node = dev->of_node; if (node == NULL) @@ -470,7 +469,7 @@ static int gpio_keys_get_devtree_pdata(struct device *dev, memset(pdata, 0, sizeof *pdata); - pdata->rep = !!of_get_property(node, "autorepeat", &len); + pdata->rep = !!of_get_property(node, "autorepeat", NULL); /* First count the subnodes */ pdata->nbuttons = 0; @@ -498,22 +497,25 @@ static int gpio_keys_get_devtree_pdata(struct device *dev, buttons[i].gpio = of_get_gpio_flags(pp, 0, &flags); buttons[i].active_low = flags & OF_GPIO_ACTIVE_LOW; - reg = of_get_property(pp, "linux,code", &len); - if (!reg) { + if (of_property_read_u32(pp, "linux,code", ®)) { dev_err(dev, "Button without keycode: 0x%x\n", buttons[i].gpio); goto out_fail; } - buttons[i].code = be32_to_cpup(reg); + buttons[i].code = reg; - buttons[i].desc = of_get_property(pp, "label", &len); + buttons[i].desc = of_get_property(pp, "label", NULL); - reg = of_get_property(pp, "linux,input-type", &len); - buttons[i].type = reg ? be32_to_cpup(reg) : EV_KEY; + if (of_property_read_u32(pp, "linux,input-type", ®) == 0) + buttons[i].type = reg; + else + buttons[i].type = EV_KEY; buttons[i].wakeup = !!of_get_property(pp, "gpio-key,wakeup", NULL); - reg = of_get_property(pp, "debounce-interval", &len); - buttons[i].debounce_interval = reg ? be32_to_cpup(reg) : 5; + if (of_property_read_u32(pp, "debounce-interval", ®) == 0) + buttons[i].debounce_interval = reg; + else + buttons[i].debounce_interval = 5; i++; } |