aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-05-21 15:52:33 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-22 00:54:44 -0400
commitdaea34bc6f67cf3872d1b52ba5ccf249f3ceb176 (patch)
tree8b306ee9581985c248a47eb85e530393dfcd2831 /drivers/mtd
parent7da5a05dd7b95315af49f724f623bbfdab0f5e4d (diff)
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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/mtdchar.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 129d429cd2da..aef9f4b687c9 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -28,10 +28,13 @@ static void mtd_notify_add(struct mtd_info* mtd)
28 if (!mtd) 28 if (!mtd)
29 return; 29 return;
30 30
31 device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2), "mtd%d", mtd->index); 31 device_create_drvdata(mtd_class, NULL,
32 MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
33 NULL, "mtd%d", mtd->index);
32 34
33 device_create(mtd_class, NULL, 35 device_create_drvdata(mtd_class, NULL,
34 MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), "mtd%dro", mtd->index); 36 MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
37 NULL, "mtd%dro", mtd->index);
35} 38}
36 39
37static void mtd_notify_remove(struct mtd_info* mtd) 40static void mtd_notify_remove(struct mtd_info* mtd)