summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/samsung-keypad.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-10-02 01:20:58 +0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-10-02 01:20:58 +0400
commitdde3ada3d0069855eeb353707b2b0f946191cfd6 (patch)
treebdc2d358f8dc7fc29000149ebc4db949934b15b2 /drivers/input/keyboard/samsung-keypad.c
parent5e056ef4ddeb6129f6bb170f2c26b8f370bbcda7 (diff)
parentfb4f552e895cec29934d94a99cbd1f1f00448a88 (diff)
downloadlinux-dde3ada3d0069855eeb353707b2b0f946191cfd6.tar.xz
Merge branch 'next' into for-linus
Prepare first set of updates for 3.7 merge window.
Diffstat (limited to 'drivers/input/keyboard/samsung-keypad.c')
-rw-r--r--drivers/input/keyboard/samsung-keypad.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c
index a061ba603a29..277e26dc910e 100644
--- a/drivers/input/keyboard/samsung-keypad.c
+++ b/drivers/input/keyboard/samsung-keypad.c
@@ -256,7 +256,7 @@ static struct samsung_keypad_platdata *samsung_keypad_parse_dt(
struct matrix_keymap_data *keymap_data;
uint32_t *keymap, num_rows = 0, num_cols = 0;
struct device_node *np = dev->of_node, *key_np;
- unsigned int key_count = 0;
+ unsigned int key_count;
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata) {
@@ -280,9 +280,7 @@ static struct samsung_keypad_platdata *samsung_keypad_parse_dt(
}
pdata->keymap_data = keymap_data;
- for_each_child_of_node(np, key_np)
- key_count++;
-
+ key_count = of_get_child_count(np);
keymap_data->keymap_size = key_count;
keymap = devm_kzalloc(dev, sizeof(uint32_t) * key_count, GFP_KERNEL);
if (!keymap) {
@@ -662,8 +660,6 @@ static const struct of_device_id samsung_keypad_dt_match[] = {
{},
};
MODULE_DEVICE_TABLE(of, samsung_keypad_dt_match);
-#else
-#define samsung_keypad_dt_match NULL
#endif
static struct platform_device_id samsung_keypad_driver_ids[] = {
@@ -684,7 +680,7 @@ static struct platform_driver samsung_keypad_driver = {
.driver = {
.name = "samsung-keypad",
.owner = THIS_MODULE,
- .of_match_table = samsung_keypad_dt_match,
+ .of_match_table = of_match_ptr(samsung_keypad_dt_match),
.pm = &samsung_keypad_pm_ops,
},
.id_table = samsung_keypad_driver_ids,