diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-01 17:20:58 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-10-01 17:20:58 -0400 |
commit | dde3ada3d0069855eeb353707b2b0f946191cfd6 (patch) | |
tree | bdc2d358f8dc7fc29000149ebc4db949934b15b2 /drivers/input/input.c | |
parent | 5e056ef4ddeb6129f6bb170f2c26b8f370bbcda7 (diff) | |
parent | fb4f552e895cec29934d94a99cbd1f1f00448a88 (diff) |
Merge branch 'next' into for-linus
Prepare first set of updates for 3.7 merge window.
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r-- | drivers/input/input.c | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 8921c6180c51..768e46b05ef0 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -844,18 +844,10 @@ int input_set_keycode(struct input_dev *dev, | |||
844 | } | 844 | } |
845 | EXPORT_SYMBOL(input_set_keycode); | 845 | EXPORT_SYMBOL(input_set_keycode); |
846 | 846 | ||
847 | #define MATCH_BIT(bit, max) \ | ||
848 | for (i = 0; i < BITS_TO_LONGS(max); i++) \ | ||
849 | if ((id->bit[i] & dev->bit[i]) != id->bit[i]) \ | ||
850 | break; \ | ||
851 | if (i != BITS_TO_LONGS(max)) \ | ||
852 | continue; | ||
853 | |||
854 | static const struct input_device_id *input_match_device(struct input_handler *handler, | 847 | static const struct input_device_id *input_match_device(struct input_handler *handler, |
855 | struct input_dev *dev) | 848 | struct input_dev *dev) |
856 | { | 849 | { |
857 | const struct input_device_id *id; | 850 | const struct input_device_id *id; |
858 | int i; | ||
859 | 851 | ||
860 | for (id = handler->id_table; id->flags || id->driver_info; id++) { | 852 | for (id = handler->id_table; id->flags || id->driver_info; id++) { |
861 | 853 | ||
@@ -875,15 +867,32 @@ static const struct input_device_id *input_match_device(struct input_handler *ha | |||
875 | if (id->version != dev->id.version) | 867 | if (id->version != dev->id.version) |
876 | continue; | 868 | continue; |
877 | 869 | ||
878 | MATCH_BIT(evbit, EV_MAX); | 870 | if (!bitmap_subset(id->evbit, dev->evbit, EV_MAX)) |
879 | MATCH_BIT(keybit, KEY_MAX); | 871 | continue; |
880 | MATCH_BIT(relbit, REL_MAX); | 872 | |
881 | MATCH_BIT(absbit, ABS_MAX); | 873 | if (!bitmap_subset(id->keybit, dev->keybit, KEY_MAX)) |
882 | MATCH_BIT(mscbit, MSC_MAX); | 874 | continue; |
883 | MATCH_BIT(ledbit, LED_MAX); | 875 | |
884 | MATCH_BIT(sndbit, SND_MAX); | 876 | if (!bitmap_subset(id->relbit, dev->relbit, REL_MAX)) |
885 | MATCH_BIT(ffbit, FF_MAX); | 877 | continue; |
886 | MATCH_BIT(swbit, SW_MAX); | 878 | |
879 | if (!bitmap_subset(id->absbit, dev->absbit, ABS_MAX)) | ||
880 | continue; | ||
881 | |||
882 | if (!bitmap_subset(id->mscbit, dev->mscbit, MSC_MAX)) | ||
883 | continue; | ||
884 | |||
885 | if (!bitmap_subset(id->ledbit, dev->ledbit, LED_MAX)) | ||
886 | continue; | ||
887 | |||
888 | if (!bitmap_subset(id->sndbit, dev->sndbit, SND_MAX)) | ||
889 | continue; | ||
890 | |||
891 | if (!bitmap_subset(id->ffbit, dev->ffbit, FF_MAX)) | ||
892 | continue; | ||
893 | |||
894 | if (!bitmap_subset(id->swbit, dev->swbit, SW_MAX)) | ||
895 | continue; | ||
887 | 896 | ||
888 | if (!handler->match || handler->match(handler, dev)) | 897 | if (!handler->match || handler->match(handler, dev)) |
889 | return id; | 898 | return id; |