device create: char: convert device_create to device_create_drvdata
device_create() is race-prone, so use the race-free device_create_drvdata() instead as device_create() is going away. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
@@ -989,9 +989,9 @@ static int __init chr_dev_init(void)
|
||||
|
||||
mem_class = class_create(THIS_MODULE, "mem");
|
||||
for (i = 0; i < ARRAY_SIZE(devlist); i++)
|
||||
device_create(mem_class, NULL,
|
||||
MKDEV(MEM_MAJOR, devlist[i].minor),
|
||||
devlist[i].name);
|
||||
device_create_drvdata(mem_class, NULL,
|
||||
MKDEV(MEM_MAJOR, devlist[i].minor),
|
||||
NULL, devlist[i].name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user