Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: 88pm860x: Convert to managed resources for allocating memory

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Lee Jones and committed by
Samuel Ortiz
a1ace0aa 02c7d848

+2 -3
+2 -3
drivers/mfd/88pm860x-core.c
··· 1150 1150 return -EINVAL; 1151 1151 } 1152 1152 1153 - chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); 1153 + chip = devm_kzalloc(&client->dev, 1154 + sizeof(struct pm860x_chip), GFP_KERNEL); 1154 1155 if (chip == NULL) 1155 1156 return -ENOMEM; 1156 1157 ··· 1161 1160 ret = PTR_ERR(chip->regmap); 1162 1161 dev_err(&client->dev, "Failed to allocate register map: %d\n", 1163 1162 ret); 1164 - kfree(chip); 1165 1163 return ret; 1166 1164 } 1167 1165 chip->client = client; ··· 1203 1203 regmap_exit(chip->regmap_companion); 1204 1204 i2c_unregister_device(chip->companion); 1205 1205 } 1206 - kfree(chip); 1207 1206 return 0; 1208 1207 } 1209 1208