Commit c58f6616 authored by Denis Carikli's avatar Denis Carikli Committed by Tomi Valkeinen

video: mx3fb: Use devm_kzalloc

Replace kzalloc by devm_kzalloc and remove the kfree() calls.
Signed-off-by: default avatarDenis Carikli <denis@eukrea.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent e3e11f51
...@@ -1496,7 +1496,7 @@ static int mx3fb_probe(struct platform_device *pdev) ...@@ -1496,7 +1496,7 @@ static int mx3fb_probe(struct platform_device *pdev)
if (!sdc_reg) if (!sdc_reg)
return -EINVAL; return -EINVAL;
mx3fb = kzalloc(sizeof(*mx3fb), GFP_KERNEL); mx3fb = devm_kzalloc(&pdev->dev, sizeof(*mx3fb), GFP_KERNEL);
if (!mx3fb) if (!mx3fb)
return -ENOMEM; return -ENOMEM;
...@@ -1542,7 +1542,6 @@ static int mx3fb_probe(struct platform_device *pdev) ...@@ -1542,7 +1542,6 @@ static int mx3fb_probe(struct platform_device *pdev)
dmaengine_put(); dmaengine_put();
iounmap(mx3fb->reg_base); iounmap(mx3fb->reg_base);
eremap: eremap:
kfree(mx3fb);
dev_err(dev, "mx3fb: failed to register fb\n"); dev_err(dev, "mx3fb: failed to register fb\n");
return ret; return ret;
} }
...@@ -1561,7 +1560,6 @@ static int mx3fb_remove(struct platform_device *dev) ...@@ -1561,7 +1560,6 @@ static int mx3fb_remove(struct platform_device *dev)
dmaengine_put(); dmaengine_put();
iounmap(mx3fb->reg_base); iounmap(mx3fb->reg_base);
kfree(mx3fb);
return 0; return 0;
} }
......
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