Commit c1f383d9 authored by Damien Cassou's avatar Damien Cassou Committed by Florian Tobias Schandinat

drivers/video/fsl-diu-fb.c: use devm_ functions

The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.
Signed-off-by: default avatarDamien Cassou <damien.cassou@lifl.fr>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent ae1937f6
...@@ -1501,8 +1501,8 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev) ...@@ -1501,8 +1501,8 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
unsigned int i; unsigned int i;
int ret; int ret;
data = dma_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data = dmam_alloc_coherent(&pdev->dev, sizeof(struct fsl_diu_data),
&dma_addr, GFP_DMA | __GFP_ZERO); &dma_addr, GFP_DMA | __GFP_ZERO);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
data->dma_addr = dma_addr; data->dma_addr = dma_addr;
...@@ -1628,9 +1628,6 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev) ...@@ -1628,9 +1628,6 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
iounmap(data->diu_reg); iounmap(data->diu_reg);
dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data,
data->dma_addr);
return ret; return ret;
} }
...@@ -1648,9 +1645,6 @@ static int fsl_diu_remove(struct platform_device *pdev) ...@@ -1648,9 +1645,6 @@ static int fsl_diu_remove(struct platform_device *pdev)
iounmap(data->diu_reg); iounmap(data->diu_reg);
dma_free_coherent(&pdev->dev, sizeof(struct fsl_diu_data), data,
data->dma_addr);
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