aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2013-11-04 01:49:35 -0500
committerIngo Molnar <mingo@kernel.org>2013-11-04 01:49:35 -0500
commit2a3ede8cb2ddee5885518e4232aca13056f9a6e0 (patch)
tree79b2b4e060a97b1e7c60d58549f8c97cb15db5dd /drivers/input/input.c
parent0e73453e172aaa38fd59fd4d3fc589e8fc9b9a70 (diff)
parent215432ed30393ed4a8f77db0a1fe34523c48cdba (diff)
Merge branch 'perf/urgent' into perf/core to fix conflicts
Conflicts: tools/perf/bench/numa.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index c04469928925..e75d015024a1 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1734,6 +1734,7 @@ EXPORT_SYMBOL_GPL(input_class);
1734 */ 1734 */
1735struct input_dev *input_allocate_device(void) 1735struct input_dev *input_allocate_device(void)
1736{ 1736{
1737 static atomic_t input_no = ATOMIC_INIT(0);
1737 struct input_dev *dev; 1738 struct input_dev *dev;
1738 1739
1739 dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL); 1740 dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL);
@@ -1743,9 +1744,13 @@ struct input_dev *input_allocate_device(void)
1743 device_initialize(&dev->dev); 1744 device_initialize(&dev->dev);
1744 mutex_init(&dev->mutex); 1745 mutex_init(&dev->mutex);
1745 spin_lock_init(&dev->event_lock); 1746 spin_lock_init(&dev->event_lock);
1747 init_timer(&dev->timer);
1746 INIT_LIST_HEAD(&dev->h_list); 1748 INIT_LIST_HEAD(&dev->h_list);
1747 INIT_LIST_HEAD(&dev->node); 1749 INIT_LIST_HEAD(&dev->node);
1748 1750
1751 dev_set_name(&dev->dev, "input%ld",
1752 (unsigned long) atomic_inc_return(&input_no) - 1);
1753
1749 __module_get(THIS_MODULE); 1754 __module_get(THIS_MODULE);
1750 } 1755 }
1751 1756
@@ -2019,7 +2024,6 @@ static void devm_input_device_unregister(struct device *dev, void *res)
2019 */ 2024 */
2020int input_register_device(struct input_dev *dev) 2025int input_register_device(struct input_dev *dev)
2021{ 2026{
2022 static atomic_t input_no = ATOMIC_INIT(0);
2023 struct input_devres *devres = NULL; 2027 struct input_devres *devres = NULL;
2024 struct input_handler *handler; 2028 struct input_handler *handler;
2025 unsigned int packet_size; 2029 unsigned int packet_size;
@@ -2059,7 +2063,6 @@ int input_register_device(struct input_dev *dev)
2059 * If delay and period are pre-set by the driver, then autorepeating 2063 * If delay and period are pre-set by the driver, then autorepeating
2060 * is handled by the driver itself and we don't do it in input.c. 2064 * is handled by the driver itself and we don't do it in input.c.
2061 */ 2065 */
2062 init_timer(&dev->timer);
2063 if (!dev->rep[REP_DELAY] && !dev->rep[REP_PERIOD]) { 2066 if (!dev->rep[REP_DELAY] && !dev->rep[REP_PERIOD]) {
2064 dev->timer.data = (long) dev; 2067 dev->timer.data = (long) dev;
2065 dev->timer.function = input_repeat_key; 2068 dev->timer.function = input_repeat_key;
@@ -2073,9 +2076,6 @@ int input_register_device(struct input_dev *dev)
2073 if (!dev->setkeycode) 2076 if (!dev->setkeycode)
2074 dev->setkeycode = input_default_setkeycode; 2077 dev->setkeycode = input_default_setkeycode;
2075 2078
2076 dev_set_name(&dev->dev, "input%ld",
2077 (unsigned long) atomic_inc_return(&input_no) - 1);
2078
2079 error = device_add(&dev->dev); 2079 error = device_add(&dev->dev);
2080 if (error) 2080 if (error)
2081 goto err_free_vals; 2081 goto err_free_vals;