Skip to content

Commit

Permalink
device create: hid: convert device_create to device_create_drvdata
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg Kroah-Hartman committed Jul 22, 2008
1 parent 1e27440 commit 0fd15a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/hid/hidraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0fd15a1

Please sign in to comment.