mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
mfd: 88pm860x: Convert to managed resources for allocating memory
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
02c7d84894
commit
a1ace0aac5
@ -1150,7 +1150,8 @@ static int pm860x_probe(struct i2c_client *client,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL);
|
||||
chip = devm_kzalloc(&client->dev,
|
||||
sizeof(struct pm860x_chip), GFP_KERNEL);
|
||||
if (chip == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -1160,7 +1161,6 @@ static int pm860x_probe(struct i2c_client *client,
|
||||
ret = PTR_ERR(chip->regmap);
|
||||
dev_err(&client->dev, "Failed to allocate register map: %d\n",
|
||||
ret);
|
||||
kfree(chip);
|
||||
return ret;
|
||||
}
|
||||
chip->client = client;
|
||||
@ -1203,7 +1203,6 @@ static int pm860x_remove(struct i2c_client *client)
|
||||
regmap_exit(chip->regmap_companion);
|
||||
i2c_unregister_device(chip->companion);
|
||||
}
|
||||
kfree(chip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user