提交 88a447a0 编写于 作者: D Dmitry Torokhov

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: NDmitry Torokhov <dtor@mail.ru>
上级 7791bdae
...@@ -1079,6 +1079,9 @@ int input_register_device(struct input_dev *dev) ...@@ -1079,6 +1079,9 @@ int input_register_device(struct input_dev *dev)
snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id), snprintf(dev->cdev.class_id, sizeof(dev->cdev.class_id),
"input%ld", (unsigned long) atomic_inc_return(&input_no) - 1); "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); error = class_device_add(&dev->cdev);
if (error) if (error)
return error; return error;
......
...@@ -972,6 +972,9 @@ struct input_dev { ...@@ -972,6 +972,9 @@ struct input_dev {
unsigned int users; unsigned int users;
struct class_device cdev; 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 h_list;
struct list_head node; struct list_head node;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册