aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/pcf8574_keypad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/misc/pcf8574_keypad.c')
-rw-r--r--drivers/input/misc/pcf8574_keypad.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c
index e37392976fdd..0deca5a3c87f 100644
--- a/drivers/input/misc/pcf8574_keypad.c
+++ b/drivers/input/misc/pcf8574_keypad.c
@@ -113,9 +113,12 @@ static int pcf8574_kp_probe(struct i2c_client *client, const struct i2c_device_i
113 idev->keycodemax = ARRAY_SIZE(lp->btncode); 113 idev->keycodemax = ARRAY_SIZE(lp->btncode);
114 114
115 for (i = 0; i < ARRAY_SIZE(pcf8574_kp_btncode); i++) { 115 for (i = 0; i < ARRAY_SIZE(pcf8574_kp_btncode); i++) {
116 lp->btncode[i] = pcf8574_kp_btncode[i]; 116 if (lp->btncode[i] <= KEY_MAX) {
117 __set_bit(lp->btncode[i] & KEY_MAX, idev->keybit); 117 lp->btncode[i] = pcf8574_kp_btncode[i];
118 __set_bit(lp->btncode[i], idev->keybit);
119 }
118 } 120 }
121 __clear_bit(KEY_RESERVED, idev->keybit);
119 122
120 sprintf(lp->name, DRV_NAME); 123 sprintf(lp->name, DRV_NAME);
121 sprintf(lp->phys, "kp_data/input0"); 124 sprintf(lp->phys, "kp_data/input0");