diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-05-21 15:52:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-22 00:54:42 -0400 |
commit | 1cc4376c259d1950817aaa6221aad7c2058df4a8 (patch) | |
tree | 0f9ebd33dc58cc1c62974d83cc581f3fa86eeb86 /drivers | |
parent | 2871f55237e2aaa00fd724ce45b47e567974045f (diff) |
device create: i2c: 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: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/i2c-dev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c index 86727fa8858f..9d55c6383b23 100644 --- a/drivers/i2c/i2c-dev.c +++ b/drivers/i2c/i2c-dev.c | |||
@@ -521,9 +521,9 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap) | |||
521 | return PTR_ERR(i2c_dev); | 521 | return PTR_ERR(i2c_dev); |
522 | 522 | ||
523 | /* register this i2c device with the driver core */ | 523 | /* register this i2c device with the driver core */ |
524 | i2c_dev->dev = device_create(i2c_dev_class, &adap->dev, | 524 | i2c_dev->dev = device_create_drvdata(i2c_dev_class, &adap->dev, |
525 | MKDEV(I2C_MAJOR, adap->nr), | 525 | MKDEV(I2C_MAJOR, adap->nr), |
526 | "i2c-%d", adap->nr); | 526 | NULL, "i2c-%d", adap->nr); |
527 | if (IS_ERR(i2c_dev->dev)) { | 527 | if (IS_ERR(i2c_dev->dev)) { |
528 | res = PTR_ERR(i2c_dev->dev); | 528 | res = PTR_ERR(i2c_dev->dev); |
529 | goto error; | 529 | goto error; |