device create: char: 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.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman
2008-05-21 12:52:33 -07:00
parent f79f060561
commit 47aa5793f7
18 changed files with 61 additions and 49 deletions

View File

@@ -131,8 +131,8 @@ raw_ioctl(struct inode *inode, struct file *filp,
static void bind_device(struct raw_config_request *rq)
{
device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor));
device_create(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor),
"raw%d", rq->raw_minor);
device_create_drvdata(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor),
NULL, "raw%d", rq->raw_minor);
}
/*
@@ -283,7 +283,8 @@ static int __init raw_init(void)
ret = PTR_ERR(raw_class);
goto error_region;
}
device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), "rawctl");
device_create_drvdata(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL,
"rawctl");
return 0;