device create: hid: 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:42 +0000 (21:54 -0700)
device_create() is race-prone, so use the race-free
device_create_drvdata() instead as device_create() is going away.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hid/hidraw.c

index 2fde6c6..0c6b4d4 100644 (file)
@@ -322,8 +322,9 @@ int hidraw_connect(struct hid_device *hid)
                goto out;
        }
 
-       dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor),
-                               "%s%d", "hidraw", minor);
+       dev->dev = device_create_drvdata(hidraw_class, NULL,
+                                        MKDEV(hidraw_major, minor), NULL,
+                                        "%s%d", "hidraw", minor);
 
        if (IS_ERR(dev->dev)) {
                spin_lock(&minors_lock);