mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 16:29:05 +00:00
Input: serio - avoid negative serio device numbers
Fix the format string for serio device name generation to avoid negative device numbers when the id exceeds the maximum signed integer value. Signed-off-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
bf1d50fa74
commit
0224ec9e9f
@ -524,8 +524,8 @@ static void serio_init_port(struct serio *serio)
|
|||||||
spin_lock_init(&serio->lock);
|
spin_lock_init(&serio->lock);
|
||||||
mutex_init(&serio->drv_mutex);
|
mutex_init(&serio->drv_mutex);
|
||||||
device_initialize(&serio->dev);
|
device_initialize(&serio->dev);
|
||||||
dev_set_name(&serio->dev, "serio%ld",
|
dev_set_name(&serio->dev, "serio%lu",
|
||||||
(long)atomic_inc_return(&serio_no) - 1);
|
(unsigned long)atomic_inc_return(&serio_no) - 1);
|
||||||
serio->dev.bus = &serio_bus;
|
serio->dev.bus = &serio_bus;
|
||||||
serio->dev.release = serio_release_port;
|
serio->dev.release = serio_release_port;
|
||||||
serio->dev.groups = serio_device_attr_groups;
|
serio->dev.groups = serio_device_attr_groups;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user