From: Greg Kroah-Hartman Date: Wed, 21 May 2008 19:52:33 +0000 (-0700) Subject: device create: mtd: convert device_create to device_create_drvdata X-Git-Tag: v2.6.27-rc1~866^2~58 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daea34bc6f67cf3872d1b52ba5ccf249f3ceb176;p=linux-2.6 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 129d429cd2..aef9f4b687 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -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)