Commit 2871f552 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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

Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0fd15a18
...@@ -55,7 +55,8 @@ struct device *hwmon_device_register(struct device *dev) ...@@ -55,7 +55,8 @@ struct device *hwmon_device_register(struct device *dev)
return ERR_PTR(err); return ERR_PTR(err);
id = id & MAX_ID_MASK; id = id & MAX_ID_MASK;
hwdev = device_create(hwmon_class, dev, MKDEV(0,0), HWMON_ID_FORMAT, id); hwdev = device_create_drvdata(hwmon_class, dev, MKDEV(0, 0), NULL,
HWMON_ID_FORMAT, id);
if (IS_ERR(hwdev)) { if (IS_ERR(hwdev)) {
spin_lock(&idr_lock); spin_lock(&idr_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment