diff options
-rw-r--r-- | drivers/input/input.c | 3 | ||||
-rw-r--r-- | include/linux/input.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c index 86b27079004a..173c2861ec58 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -1079,6 +1079,9 @@ int input_register_device(struct input_dev *dev) | |||
1079 | snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id), | 1079 | snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id), |
1080 | "input%ld", (unsigned long) atomic_inc_return(&input_no) - 1); | 1080 | "input%ld", (unsigned long) atomic_inc_return(&input_no) - 1); |
1081 | 1081 | ||
1082 | if (!dev->cdev.dev) | ||
1083 | dev->cdev.dev = dev->dev.parent; | ||
1084 | |||
1082 | error = class_device_add(&dev->cdev); | 1085 | error = class_device_add(&dev->cdev); |
1083 | if (error) | 1086 | if (error) |
1084 | return error; | 1087 | return error; |
diff --git a/include/linux/input.h b/include/linux/input.h index d0bea9755186..7b6d7c408b07 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -972,6 +972,9 @@ struct input_dev { | |||
972 | unsigned int users; | 972 | unsigned int users; |
973 | 973 | ||
974 | struct class_device cdev; | 974 | struct class_device cdev; |
975 | union { /* temporarily so while we switching to struct device */ | ||
976 | struct device *parent; | ||
977 | } dev; | ||
975 | 978 | ||
976 | struct list_head h_list; | 979 | struct list_head h_list; |
977 | struct list_head node; | 980 | struct list_head node; |