diff options
author | David Härdeman <david@hardeman.nu> | 2014-04-03 19:32:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-25 18:10:43 -0400 |
commit | c5540fbb9de39ceec108a889133664a887c2f55a (patch) | |
tree | 92d1523fa4ab99fc27d14dcd3ee00627eeb8a346 /drivers/media/rc/rc-main.c | |
parent | da6e162d6a4607362f8478c715c797d84d449f8b (diff) |
[media] rc-core: remove protocol arrays
The basic API of rc-core used to be:
dev = rc_allocate_device();
dev->x = a;
dev->y = b;
dev->z = c;
rc_register_device();
which is a pretty common pattern in the kernel, after the introduction of
protocol arrays the API looks something like:
dev = rc_allocate_device();
dev->x = a;
rc_set_allowed_protocols(dev, RC_BIT_X);
dev->z = c;
rc_register_device();
There's no real need for the protocols to be an array, so change it
back to be consistent (and in preparation for the following patches).
[m.chehab@samsung.com: added missing changes at some files]
Signed-off-by: David Härdeman <david@hardeman.nu>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/rc/rc-main.c')
-rw-r--r-- | drivers/media/rc/rc-main.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index d5bfe6442459..c3fb8f8f192b 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c | |||
@@ -857,14 +857,14 @@ static ssize_t show_protocols(struct device *device, | |||
857 | mutex_lock(&dev->lock); | 857 | mutex_lock(&dev->lock); |
858 | 858 | ||
859 | if (fattr->type == RC_FILTER_NORMAL) { | 859 | if (fattr->type == RC_FILTER_NORMAL) { |
860 | enabled = dev->enabled_protocols[RC_FILTER_NORMAL]; | 860 | enabled = dev->enabled_protocols; |
861 | if (dev->raw) | 861 | if (dev->raw) |
862 | allowed = ir_raw_get_allowed_protocols(); | 862 | allowed = ir_raw_get_allowed_protocols(); |
863 | else | 863 | else |
864 | allowed = dev->allowed_protocols[RC_FILTER_NORMAL]; | 864 | allowed = dev->allowed_protocols; |
865 | } else { | 865 | } else { |
866 | enabled = dev->enabled_protocols[RC_FILTER_WAKEUP]; | 866 | enabled = dev->enabled_wakeup_protocols; |
867 | allowed = dev->allowed_protocols[RC_FILTER_WAKEUP]; | 867 | allowed = dev->allowed_wakeup_protocols; |
868 | } | 868 | } |
869 | 869 | ||
870 | mutex_unlock(&dev->lock); | 870 | mutex_unlock(&dev->lock); |
@@ -989,15 +989,15 @@ static ssize_t store_protocols(struct device *device, | |||
989 | 989 | ||
990 | if (fattr->type == RC_FILTER_NORMAL) { | 990 | if (fattr->type == RC_FILTER_NORMAL) { |
991 | IR_dprintk(1, "Normal protocol change requested\n"); | 991 | IR_dprintk(1, "Normal protocol change requested\n"); |
992 | current_protocols = &dev->enabled_protocols[RC_FILTER_NORMAL]; | 992 | current_protocols = &dev->enabled_protocols; |
993 | change_protocol = dev->change_protocol; | 993 | change_protocol = dev->change_protocol; |
994 | filter = &dev->scancode_filters[RC_FILTER_NORMAL]; | 994 | filter = &dev->scancode_filter; |
995 | set_filter = dev->s_filter; | 995 | set_filter = dev->s_filter; |
996 | } else { | 996 | } else { |
997 | IR_dprintk(1, "Wakeup protocol change requested\n"); | 997 | IR_dprintk(1, "Wakeup protocol change requested\n"); |
998 | current_protocols = &dev->enabled_protocols[RC_FILTER_WAKEUP]; | 998 | current_protocols = &dev->enabled_wakeup_protocols; |
999 | change_protocol = dev->change_wakeup_protocol; | 999 | change_protocol = dev->change_wakeup_protocol; |
1000 | filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; | 1000 | filter = &dev->scancode_wakeup_filter; |
1001 | set_filter = dev->s_wakeup_filter; | 1001 | set_filter = dev->s_wakeup_filter; |
1002 | } | 1002 | } |
1003 | 1003 | ||
@@ -1085,9 +1085,9 @@ static ssize_t show_filter(struct device *device, | |||
1085 | return -EINVAL; | 1085 | return -EINVAL; |
1086 | 1086 | ||
1087 | if (fattr->type == RC_FILTER_NORMAL) | 1087 | if (fattr->type == RC_FILTER_NORMAL) |
1088 | filter = &dev->scancode_filters[RC_FILTER_NORMAL]; | 1088 | filter = &dev->scancode_filter; |
1089 | else | 1089 | else |
1090 | filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; | 1090 | filter = &dev->scancode_wakeup_filter; |
1091 | 1091 | ||
1092 | mutex_lock(&dev->lock); | 1092 | mutex_lock(&dev->lock); |
1093 | if (fattr->mask) | 1093 | if (fattr->mask) |
@@ -1140,12 +1140,12 @@ static ssize_t store_filter(struct device *device, | |||
1140 | 1140 | ||
1141 | if (fattr->type == RC_FILTER_NORMAL) { | 1141 | if (fattr->type == RC_FILTER_NORMAL) { |
1142 | set_filter = dev->s_filter; | 1142 | set_filter = dev->s_filter; |
1143 | enabled_protocols = &dev->enabled_protocols[RC_FILTER_NORMAL]; | 1143 | enabled_protocols = &dev->enabled_protocols; |
1144 | filter = &dev->scancode_filters[RC_FILTER_NORMAL]; | 1144 | filter = &dev->scancode_filter; |
1145 | } else { | 1145 | } else { |
1146 | set_filter = dev->s_wakeup_filter; | 1146 | set_filter = dev->s_wakeup_filter; |
1147 | enabled_protocols = &dev->enabled_protocols[RC_FILTER_WAKEUP]; | 1147 | enabled_protocols = &dev->enabled_wakeup_protocols; |
1148 | filter = &dev->scancode_filters[RC_FILTER_WAKEUP]; | 1148 | filter = &dev->scancode_wakeup_filter; |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | if (!set_filter) | 1151 | if (!set_filter) |
@@ -1424,7 +1424,7 @@ int rc_register_device(struct rc_dev *dev) | |||
1424 | rc = dev->change_protocol(dev, &rc_type); | 1424 | rc = dev->change_protocol(dev, &rc_type); |
1425 | if (rc < 0) | 1425 | if (rc < 0) |
1426 | goto out_raw; | 1426 | goto out_raw; |
1427 | dev->enabled_protocols[RC_FILTER_NORMAL] = rc_type; | 1427 | dev->enabled_protocols = rc_type; |
1428 | } | 1428 | } |
1429 | 1429 | ||
1430 | mutex_unlock(&dev->lock); | 1430 | mutex_unlock(&dev->lock); |