aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard/gpio_keys_polled.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-07-30 01:48:33 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-08-22 01:29:49 -0400
commit2976f247989cbff1019fa3740938b0b086de5659 (patch)
tree2bc72ec3e394e45bec97e1bf3486fffdf234526e /drivers/input/keyboard/gpio_keys_polled.c
parent41091ad0b8f843d36390058362c8f3c52a26a333 (diff)
Input: gpio-keys-polled - constify pointers to platform data
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/keyboard/gpio_keys_polled.c')
-rw-r--r--drivers/input/keyboard/gpio_keys_polled.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c
index 20c8ab172214..2619297f384a 100644
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -38,7 +38,7 @@ struct gpio_keys_button_data {
38struct gpio_keys_polled_dev { 38struct gpio_keys_polled_dev {
39 struct input_polled_dev *poll_dev; 39 struct input_polled_dev *poll_dev;
40 struct device *dev; 40 struct device *dev;
41 struct gpio_keys_platform_data *pdata; 41 const struct gpio_keys_platform_data *pdata;
42 struct gpio_keys_button_data data[0]; 42 struct gpio_keys_button_data data[0];
43}; 43};
44 44
@@ -67,11 +67,11 @@ static void gpio_keys_polled_check_state(struct input_dev *input,
67static void gpio_keys_polled_poll(struct input_polled_dev *dev) 67static void gpio_keys_polled_poll(struct input_polled_dev *dev)
68{ 68{
69 struct gpio_keys_polled_dev *bdev = dev->private; 69 struct gpio_keys_polled_dev *bdev = dev->private;
70 struct gpio_keys_platform_data *pdata = bdev->pdata; 70 const struct gpio_keys_platform_data *pdata = bdev->pdata;
71 struct input_dev *input = dev->input; 71 struct input_dev *input = dev->input;
72 int i; 72 int i;
73 73
74 for (i = 0; i < bdev->pdata->nbuttons; i++) { 74 for (i = 0; i < pdata->nbuttons; i++) {
75 struct gpio_keys_button_data *bdata = &bdev->data[i]; 75 struct gpio_keys_button_data *bdata = &bdev->data[i];
76 76
77 if (bdata->count < bdata->threshold) 77 if (bdata->count < bdata->threshold)
@@ -85,7 +85,7 @@ static void gpio_keys_polled_poll(struct input_polled_dev *dev)
85static void gpio_keys_polled_open(struct input_polled_dev *dev) 85static void gpio_keys_polled_open(struct input_polled_dev *dev)
86{ 86{
87 struct gpio_keys_polled_dev *bdev = dev->private; 87 struct gpio_keys_polled_dev *bdev = dev->private;
88 struct gpio_keys_platform_data *pdata = bdev->pdata; 88 const struct gpio_keys_platform_data *pdata = bdev->pdata;
89 89
90 if (pdata->enable) 90 if (pdata->enable)
91 pdata->enable(bdev->dev); 91 pdata->enable(bdev->dev);
@@ -94,7 +94,7 @@ static void gpio_keys_polled_open(struct input_polled_dev *dev)
94static void gpio_keys_polled_close(struct input_polled_dev *dev) 94static void gpio_keys_polled_close(struct input_polled_dev *dev)
95{ 95{
96 struct gpio_keys_polled_dev *bdev = dev->private; 96 struct gpio_keys_polled_dev *bdev = dev->private;
97 struct gpio_keys_platform_data *pdata = bdev->pdata; 97 const struct gpio_keys_platform_data *pdata = bdev->pdata;
98 98
99 if (pdata->disable) 99 if (pdata->disable)
100 pdata->disable(bdev->dev); 100 pdata->disable(bdev->dev);
@@ -102,8 +102,8 @@ static void gpio_keys_polled_close(struct input_polled_dev *dev)
102 102
103static int __devinit gpio_keys_polled_probe(struct platform_device *pdev) 103static int __devinit gpio_keys_polled_probe(struct platform_device *pdev)
104{ 104{
105 struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
106 struct device *dev = &pdev->dev; 105 struct device *dev = &pdev->dev;
106 const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev);
107 struct gpio_keys_polled_dev *bdev; 107 struct gpio_keys_polled_dev *bdev;
108 struct input_polled_dev *poll_dev; 108 struct input_polled_dev *poll_dev;
109 struct input_dev *input; 109 struct input_dev *input;
@@ -217,7 +217,7 @@ err_free_bdev:
217static int __devexit gpio_keys_polled_remove(struct platform_device *pdev) 217static int __devexit gpio_keys_polled_remove(struct platform_device *pdev)
218{ 218{
219 struct gpio_keys_polled_dev *bdev = platform_get_drvdata(pdev); 219 struct gpio_keys_polled_dev *bdev = platform_get_drvdata(pdev);
220 struct gpio_keys_platform_data *pdata = bdev->pdata; 220 const struct gpio_keys_platform_data *pdata = bdev->pdata;
221 int i; 221 int i;
222 222
223 input_unregister_polled_device(bdev->poll_dev); 223 input_unregister_polled_device(bdev->poll_dev);