mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
device create: mtd: 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. Cc: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
7da5a05dd7
commit
daea34bc6f
1 changed files with 6 additions and 3 deletions
|
@ -28,10 +28,13 @@ static void mtd_notify_add(struct mtd_info* mtd)
|
|||
if (!mtd)
|
||||
return;
|
||||
|
||||
device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2), "mtd%d", mtd->index);
|
||||
device_create_drvdata(mtd_class, NULL,
|
||||
MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
|
||||
NULL, "mtd%d", mtd->index);
|
||||
|
||||
device_create(mtd_class, NULL,
|
||||
MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), "mtd%dro", mtd->index);
|
||||
device_create_drvdata(mtd_class, NULL,
|
||||
MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
|
||||
NULL, "mtd%dro", mtd->index);
|
||||
}
|
||||
|
||||
static void mtd_notify_remove(struct mtd_info* mtd)
|
||||
|
|
Loading…
Reference in a new issue