device create: mips: convert device_create to device_create_drvdata
authorGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 May 2008 19:52:33 +0000 (12:52 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 22 Jul 2008 04:54:43 +0000 (21:54 -0700)
device_create() is race-prone, so use the race-free
device_create_drvdata() instead as device_create() is going away.

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/mips/kernel/rtlx.c
arch/mips/sibyte/common/sb_tbprof.c

index b556419612329a26fdf4493b8d4c1ee43073d4a7..dfd868b683640634f7d128f883f53165b73595fb 100644 (file)
@@ -522,8 +522,8 @@ static int __init rtlx_module_init(void)
                atomic_set(&channel_wqs[i].in_open, 0);
                mutex_init(&channel_wqs[i].mutex);
 
-               dev = device_create(mt_class, NULL, MKDEV(major, i),
-                                   "%s%d", module_name, i);
+               dev = device_create_drvdata(mt_class, NULL, MKDEV(major, i),
+                                           NULL, "%s%d", module_name, i);
                if (IS_ERR(dev)) {
                        err = PTR_ERR(dev);
                        goto out_chrdev;
index 28b012ab8dcb7ae6c06eaac75789cbf08d861a4c..66e3e3fb311f9a413ffb3dbc58aa9174fe101fe5 100644 (file)
@@ -576,7 +576,8 @@ static int __init sbprof_tb_init(void)
 
        tb_class = tbc;
 
-       dev = device_create(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), "tb");
+       dev = device_create_drvdata(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0),
+                                   NULL, "tb");
        if (IS_ERR(dev)) {
                err = PTR_ERR(dev);
                goto out_class;