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

mfd: tps65912: Convert to managed resources for allocating memory

Saves on code and simplifies the driver, as these resources are now
tracked and freed automatically when the driver is realised.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Lee Jones and committed by
Samuel Ortiz
b3fff177 c5fa44d1

+4 -4
-2
drivers/mfd/tps65912-core.c
··· 162 162 err: 163 163 kfree(init_data); 164 164 mfd_remove_devices(tps65912->dev); 165 - kfree(tps65912); 166 165 return ret; 167 166 } 168 167 ··· 169 170 { 170 171 mfd_remove_devices(tps65912->dev); 171 172 tps65912_irq_exit(tps65912); 172 - kfree(tps65912); 173 173 } 174 174 175 175 MODULE_AUTHOR("Margarita Olaya <magi@slimlogic.co.uk>");
+2 -1
drivers/mfd/tps65912-i2c.c
··· 77 77 { 78 78 struct tps65912 *tps65912; 79 79 80 - tps65912 = kzalloc(sizeof(struct tps65912), GFP_KERNEL); 80 + tps65912 = devm_kzalloc(&i2c->dev, 81 + sizeof(struct tps65912), GFP_KERNEL); 81 82 if (tps65912 == NULL) 82 83 return -ENOMEM; 83 84
+2 -1
drivers/mfd/tps65912-spi.c
··· 85 85 { 86 86 struct tps65912 *tps65912; 87 87 88 - tps65912 = kzalloc(sizeof(struct tps65912), GFP_KERNEL); 88 + tps65912 = devm_kzalloc(&spi->dev, 89 + sizeof(struct tps65912), GFP_KERNEL); 89 90 if (tps65912 == NULL) 90 91 return -ENOMEM; 91 92