diff --git a/drivers/input/input.c b/drivers/input/input.c index 86b27079004a79697d25fae8f31b792d147ecf1a..173c2861ec58fd3bee32950385d59f08cab8f0cb 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1079,6 +1079,9 @@ int input_register_device(struct input_dev *dev) snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id), "input%ld", (unsigned long) atomic_inc_return(&input_no) - 1); + if (!dev->cdev.dev) + dev->cdev.dev = dev->dev.parent; + error = class_device_add(&dev->cdev); if (error) return error; diff --git a/include/linux/input.h b/include/linux/input.h index d0bea9755186e44746b68ee3d42c068e99131f05..7b6d7c408b075506d923e90a8983fc9873ae55f5 100644 --- a/include/linux/input.h +++ b/include/linux/input.h @@ -972,6 +972,9 @@ struct input_dev { unsigned int users; struct class_device cdev; + union { /* temporarily so while we switching to struct device */ + struct device *parent; + } dev; struct list_head h_list; struct list_head node;