mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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>
This commit is contained in:
parent
2871f55237
commit
1cc4376c25
1 changed files with 3 additions and 3 deletions
|
@ -521,9 +521,9 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
|
|||
return PTR_ERR(i2c_dev);
|
||||
|
||||
/* register this i2c device with the driver core */
|
||||
i2c_dev->dev = device_create(i2c_dev_class, &adap->dev,
|
||||
MKDEV(I2C_MAJOR, adap->nr),
|
||||
"i2c-%d", adap->nr);
|
||||
i2c_dev->dev = device_create_drvdata(i2c_dev_class, &adap->dev,
|
||||
MKDEV(I2C_MAJOR, adap->nr),
|
||||
NULL, "i2c-%d", adap->nr);
|
||||
if (IS_ERR(i2c_dev->dev)) {
|
||||
res = PTR_ERR(i2c_dev->dev);
|
||||
goto error;
|
||||
|
|
Loading…
Reference in a new issue