aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/rc-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/rc/rc-main.c')
-rw-r--r--drivers/media/rc/rc-main.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index caa8d70de726..b989f5d98d5f 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -94,7 +94,7 @@ void ir_unregister_map(struct rc_keymap *map)
94EXPORT_SYMBOL_GPL(ir_unregister_map); 94EXPORT_SYMBOL_GPL(ir_unregister_map);
95 95
96 96
97static struct ir_scancode empty[] = { 97static struct rc_map_table empty[] = {
98 { 0x2a, KEY_COFFEE }, 98 { 0x2a, KEY_COFFEE },
99}; 99};
100 100
@@ -123,8 +123,8 @@ static int ir_create_table(struct rc_map *rc_map,
123{ 123{
124 rc_map->name = name; 124 rc_map->name = name;
125 rc_map->rc_type = rc_type; 125 rc_map->rc_type = rc_type;
126 rc_map->alloc = roundup_pow_of_two(size * sizeof(struct ir_scancode)); 126 rc_map->alloc = roundup_pow_of_two(size * sizeof(struct rc_map_table));
127 rc_map->size = rc_map->alloc / sizeof(struct ir_scancode); 127 rc_map->size = rc_map->alloc / sizeof(struct rc_map_table);
128 rc_map->scan = kmalloc(rc_map->alloc, GFP_KERNEL); 128 rc_map->scan = kmalloc(rc_map->alloc, GFP_KERNEL);
129 if (!rc_map->scan) 129 if (!rc_map->scan)
130 return -ENOMEM; 130 return -ENOMEM;
@@ -161,8 +161,8 @@ static int ir_resize_table(struct rc_map *rc_map, gfp_t gfp_flags)
161{ 161{
162 unsigned int oldalloc = rc_map->alloc; 162 unsigned int oldalloc = rc_map->alloc;
163 unsigned int newalloc = oldalloc; 163 unsigned int newalloc = oldalloc;
164 struct ir_scancode *oldscan = rc_map->scan; 164 struct rc_map_table *oldscan = rc_map->scan;
165 struct ir_scancode *newscan; 165 struct rc_map_table *newscan;
166 166
167 if (rc_map->size == rc_map->len) { 167 if (rc_map->size == rc_map->len) {
168 /* All entries in use -> grow keytable */ 168 /* All entries in use -> grow keytable */
@@ -188,10 +188,10 @@ static int ir_resize_table(struct rc_map *rc_map, gfp_t gfp_flags)
188 return -ENOMEM; 188 return -ENOMEM;
189 } 189 }
190 190
191 memcpy(newscan, rc_map->scan, rc_map->len * sizeof(struct ir_scancode)); 191 memcpy(newscan, rc_map->scan, rc_map->len * sizeof(struct rc_map_table));
192 rc_map->scan = newscan; 192 rc_map->scan = newscan;
193 rc_map->alloc = newalloc; 193 rc_map->alloc = newalloc;
194 rc_map->size = rc_map->alloc / sizeof(struct ir_scancode); 194 rc_map->size = rc_map->alloc / sizeof(struct rc_map_table);
195 kfree(oldscan); 195 kfree(oldscan);
196 return 0; 196 return 0;
197} 197}
@@ -221,7 +221,7 @@ static unsigned int ir_update_mapping(struct rc_dev *dev,
221 index, rc_map->scan[index].scancode); 221 index, rc_map->scan[index].scancode);
222 rc_map->len--; 222 rc_map->len--;
223 memmove(&rc_map->scan[index], &rc_map->scan[index+ 1], 223 memmove(&rc_map->scan[index], &rc_map->scan[index+ 1],
224 (rc_map->len - index) * sizeof(struct ir_scancode)); 224 (rc_map->len - index) * sizeof(struct rc_map_table));
225 } else { 225 } else {
226 IR_dprintk(1, "#%d: %s scan 0x%04x with key 0x%04x\n", 226 IR_dprintk(1, "#%d: %s scan 0x%04x with key 0x%04x\n",
227 index, 227 index,
@@ -300,7 +300,7 @@ static unsigned int ir_establish_scancode(struct rc_dev *dev,
300 /* i is the proper index to insert our new keycode */ 300 /* i is the proper index to insert our new keycode */
301 if (i < rc_map->len) 301 if (i < rc_map->len)
302 memmove(&rc_map->scan[i + 1], &rc_map->scan[i], 302 memmove(&rc_map->scan[i + 1], &rc_map->scan[i],
303 (rc_map->len - i) * sizeof(struct ir_scancode)); 303 (rc_map->len - i) * sizeof(struct rc_map_table));
304 rc_map->scan[i].scancode = scancode; 304 rc_map->scan[i].scancode = scancode;
305 rc_map->scan[i].keycode = KEY_RESERVED; 305 rc_map->scan[i].keycode = KEY_RESERVED;
306 rc_map->len++; 306 rc_map->len++;
@@ -440,7 +440,7 @@ static int ir_getkeycode(struct input_dev *idev,
440{ 440{
441 struct rc_dev *rdev = input_get_drvdata(idev); 441 struct rc_dev *rdev = input_get_drvdata(idev);
442 struct rc_map *rc_map = &rdev->rc_map; 442 struct rc_map *rc_map = &rdev->rc_map;
443 struct ir_scancode *entry; 443 struct rc_map_table *entry;
444 unsigned long flags; 444 unsigned long flags;
445 unsigned int index; 445 unsigned int index;
446 unsigned int scancode; 446 unsigned int scancode;