video: sa1100fb: use devm_kzalloc()

Use devm_kzalloc() when allocating the private data for the framebuffer
device.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
This commit is contained in:
Russell King 2017-10-17 16:01:12 +02:00 committed by Bartlomiej Zolnierkiewicz
parent 5eabff1cb9
commit ba1d36ba09
1 changed files with 2 additions and 4 deletions

View File

@ -1132,12 +1132,11 @@ static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev)
struct sa1100fb_info *fbi;
unsigned i;
fbi = kmalloc(sizeof(struct sa1100fb_info) + sizeof(u32) * 16,
GFP_KERNEL);
fbi = devm_kzalloc(dev, sizeof(struct sa1100fb_info) + sizeof(u32) * 16,
GFP_KERNEL);
if (!fbi)
return NULL;
memset(fbi, 0, sizeof(struct sa1100fb_info));
fbi->dev = dev;
strcpy(fbi->fb.fix.id, SA1100_NAME);
@ -1292,7 +1291,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
iounmap(fbi->base);
if (fbi->clk)
clk_put(fbi->clk);
kfree(fbi);
release_mem_region(res->start, resource_size(res));
return ret;
}