Commit ba1d36ba authored by Russell King's avatar Russell King Committed by Bartlomiej Zolnierkiewicz

video: sa1100fb: use devm_kzalloc()

Use devm_kzalloc() when allocating the private data for the framebuffer
device.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
parent 5eabff1c
...@@ -1132,12 +1132,11 @@ static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev) ...@@ -1132,12 +1132,11 @@ static struct sa1100fb_info *sa1100fb_init_fbinfo(struct device *dev)
struct sa1100fb_info *fbi; struct sa1100fb_info *fbi;
unsigned i; unsigned i;
fbi = kmalloc(sizeof(struct sa1100fb_info) + sizeof(u32) * 16, fbi = devm_kzalloc(dev, sizeof(struct sa1100fb_info) + sizeof(u32) * 16,
GFP_KERNEL); GFP_KERNEL);
if (!fbi) if (!fbi)
return NULL; return NULL;
memset(fbi, 0, sizeof(struct sa1100fb_info));
fbi->dev = dev; fbi->dev = dev;
strcpy(fbi->fb.fix.id, SA1100_NAME); strcpy(fbi->fb.fix.id, SA1100_NAME);
...@@ -1292,7 +1291,6 @@ static int sa1100fb_probe(struct platform_device *pdev) ...@@ -1292,7 +1291,6 @@ static int sa1100fb_probe(struct platform_device *pdev)
iounmap(fbi->base); iounmap(fbi->base);
if (fbi->clk) if (fbi->clk)
clk_put(fbi->clk); clk_put(fbi->clk);
kfree(fbi);
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment