aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-input.c')
-rw-r--r--drivers/hid/hid-input.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 52de9a914a82..a87b059f866f 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -244,7 +244,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
244 struct hid_usage *usage) 244 struct hid_usage *usage)
245{ 245{
246 struct input_dev *input = hidinput->input; 246 struct input_dev *input = hidinput->input;
247 struct hid_device *device = input->private; 247 struct hid_device *device = input_get_drvdata(input);
248 int max = 0, code; 248 int max = 0, code;
249 unsigned long *bit = NULL; 249 unsigned long *bit = NULL;
250 250
@@ -859,13 +859,15 @@ EXPORT_SYMBOL_GPL(hidinput_find_field);
859 859
860static int hidinput_open(struct input_dev *dev) 860static int hidinput_open(struct input_dev *dev)
861{ 861{
862 struct hid_device *hid = dev->private; 862 struct hid_device *hid = input_get_drvdata(dev);
863
863 return hid->hid_open(hid); 864 return hid->hid_open(hid);
864} 865}
865 866
866static void hidinput_close(struct input_dev *dev) 867static void hidinput_close(struct input_dev *dev)
867{ 868{
868 struct hid_device *hid = dev->private; 869 struct hid_device *hid = input_get_drvdata(dev);
870
869 hid->hid_close(hid); 871 hid->hid_close(hid);
870} 872}
871 873
@@ -913,7 +915,7 @@ int hidinput_connect(struct hid_device *hid)
913 return -1; 915 return -1;
914 } 916 }
915 917
916 input_dev->private = hid; 918 input_set_drvdata(input_dev, hid);
917 input_dev->event = hid->hidinput_input_event; 919 input_dev->event = hid->hidinput_input_event;
918 input_dev->open = hidinput_open; 920 input_dev->open = hidinput_open;
919 input_dev->close = hidinput_close; 921 input_dev->close = hidinput_close;
@@ -925,7 +927,7 @@ int hidinput_connect(struct hid_device *hid)
925 input_dev->id.vendor = hid->vendor; 927 input_dev->id.vendor = hid->vendor;
926 input_dev->id.product = hid->product; 928 input_dev->id.product = hid->product;
927 input_dev->id.version = hid->version; 929 input_dev->id.version = hid->version;
928 input_dev->cdev.dev = hid->dev; 930 input_dev->dev.parent = hid->dev;
929 hidinput->input = input_dev; 931 hidinput->input = input_dev;
930 list_add_tail(&hidinput->list, &hid->inputs); 932 list_add_tail(&hidinput->list, &hid->inputs);
931 } 933 }