]> Pileus Git - ~andy/linux/blobdiff - drivers/input/keyboard/bf54x-keys.c
Merge tag 'v3.13-rc4' into next
[~andy/linux] / drivers / input / keyboard / bf54x-keys.c
index fc88fb48d70d6740ef96f8fdbe9afc32760218c5..16223f4599d425704c9ddf3ad613e9ab03790ae9 100644 (file)
@@ -180,7 +180,7 @@ static irqreturn_t bfin_kpad_isr(int irq, void *dev_id)
 static int bfin_kpad_probe(struct platform_device *pdev)
 {
        struct bf54x_kpad *bf54x_kpad;
-       struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data;
+       struct bfin_kpad_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct input_dev *input;
        int i, error;
 
@@ -289,7 +289,8 @@ static int bfin_kpad_probe(struct platform_device *pdev)
                __set_bit(EV_REP, input->evbit);
 
        for (i = 0; i < input->keycodemax; i++)
-               __set_bit(bf54x_kpad->keycode[i] & KEY_MAX, input->keybit);
+               if (bf54x_kpad->keycode[i] <= KEY_MAX)
+                       __set_bit(bf54x_kpad->keycode[i], input->keybit);
        __clear_bit(KEY_RESERVED, input->keybit);
 
        error = input_register_device(input);
@@ -332,7 +333,7 @@ out:
 
 static int bfin_kpad_remove(struct platform_device *pdev)
 {
-       struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data;
+       struct bfin_kpad_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev);
 
        del_timer_sync(&bf54x_kpad->timer);