]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
device create: hwmon: 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.

Cc: Mark M. Hoffman <mhoffman@lightlink.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/hwmon.c

index 3db28450a3b34504facc27cc8a9611a8e53569cd..7321a88a51128adef8ba40016e03f0648b7e4a97 100644 (file)
@@ -55,7 +55,8 @@ again:
                return ERR_PTR(err);
 
        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)) {
                spin_lock(&idr_lock);