提交 a98894ab 编写于 作者: T Tony Jones 提交者: Greg Kroah-Hartman

mtd: Convert from class_device to device for MTD/mtdchar

struct class_device is going away, this converts the code to use struct
device instead.
Signed-off-by: NTony Jones <tonyj@suse.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 0c55445f
...@@ -27,12 +27,10 @@ static void mtd_notify_add(struct mtd_info* mtd) ...@@ -27,12 +27,10 @@ static void mtd_notify_add(struct mtd_info* mtd)
if (!mtd) if (!mtd)
return; return;
class_device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2), device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2), "mtd%d", mtd->index);
NULL, "mtd%d", mtd->index);
class_device_create(mtd_class, NULL, device_create(mtd_class, NULL,
MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), "mtd%dro", mtd->index);
NULL, "mtd%dro", mtd->index);
} }
static void mtd_notify_remove(struct mtd_info* mtd) static void mtd_notify_remove(struct mtd_info* mtd)
...@@ -40,8 +38,8 @@ static void mtd_notify_remove(struct mtd_info* mtd) ...@@ -40,8 +38,8 @@ static void mtd_notify_remove(struct mtd_info* mtd)
if (!mtd) if (!mtd)
return; return;
class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2)); device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2));
class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1)); device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1));
} }
static struct mtd_notifier notifier = { static struct mtd_notifier notifier = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册