From b3fff1770a33abb1905eae2baa8dffd48e5913ae Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Thu, 23 May 2013 16:25:02 +0100 Subject: 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 Signed-off-by: Samuel Ortiz --- drivers/mfd/tps65912-spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/mfd/tps65912-spi.c') diff --git a/drivers/mfd/tps65912-spi.c b/drivers/mfd/tps65912-spi.c index b45f460d299f..69a5178bf152 100644 --- a/drivers/mfd/tps65912-spi.c +++ b/drivers/mfd/tps65912-spi.c @@ -85,7 +85,8 @@ static int tps65912_spi_probe(struct spi_device *spi) { struct tps65912 *tps65912; - tps65912 = kzalloc(sizeof(struct tps65912), GFP_KERNEL); + tps65912 = devm_kzalloc(&spi->dev, + sizeof(struct tps65912), GFP_KERNEL); if (tps65912 == NULL) return -ENOMEM; -- cgit v1.2.3