mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
Input: prepare to switching to struct device
In preparation to switching to struct device and class device going away provide an alias to allow drivers that create devices to use either input_dev->cdev.dev or input_dev->dev.parent to put them into sysfs tree. The former will go away once conversion to struct device is complete. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
7791bdae71
commit
88a447a030
2 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue