aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fsl-diu-fb.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-09-15 17:44:52 -0400
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-09-18 16:08:57 -0400
commitbada04fcda8bd2a2bfd5519a6a7265ec9896b435 (patch)
tree842b107a958196c0734578c91f7d1ad4e3d66157 /drivers/video/fsl-diu-fb.c
parent63cf8df44e522e2807ccbd0d55b851a89a311bc2 (diff)
drivers/video: fsl-diu-fb: improve local variable usage in some functions
Clean up the local variable usage in request_irq_local() and allocate_buf(). This streamlines the code without affecting functionality. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/fsl-diu-fb.c')
-rw-r--r--drivers/video/fsl-diu-fb.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index c89395450ee7..4d22399be177 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1265,14 +1265,14 @@ static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
1265 1265
1266static int request_irq_local(int irq) 1266static int request_irq_local(int irq)
1267{ 1267{
1268 unsigned long status, ints; 1268 u32 ints;
1269 struct diu *hw; 1269 struct diu *hw;
1270 int ret; 1270 int ret;
1271 1271
1272 hw = dr.diu_reg; 1272 hw = dr.diu_reg;
1273 1273
1274 /* Read to clear the status */ 1274 /* Read to clear the status */
1275 status = in_be32(&hw->int_status); 1275 in_be32(&hw->int_status);
1276 1276
1277 ret = request_irq(irq, fsl_diu_isr, 0, "diu", NULL); 1277 ret = request_irq(irq, fsl_diu_isr, 0, "diu", NULL);
1278 if (!ret) { 1278 if (!ret) {
@@ -1285,7 +1285,7 @@ static int request_irq_local(int irq)
1285 ints |= INT_VSYNC_WB; 1285 ints |= INT_VSYNC_WB;
1286 1286
1287 /* Read to clear the status */ 1287 /* Read to clear the status */
1288 status = in_be32(&hw->int_status); 1288 in_be32(&hw->int_status);
1289 out_be32(&hw->int_mask, ints); 1289 out_be32(&hw->int_mask, ints);
1290 } 1290 }
1291 1291
@@ -1336,23 +1336,20 @@ static int fsl_diu_resume(struct platform_device *ofdev)
1336static int allocate_buf(struct device *dev, struct diu_addr *buf, u32 size, 1336static int allocate_buf(struct device *dev, struct diu_addr *buf, u32 size,
1337 u32 bytes_align) 1337 u32 bytes_align)
1338{ 1338{
1339 u32 offset, ssize; 1339 u32 offset;
1340 u32 mask; 1340 dma_addr_t mask;
1341 dma_addr_t paddr = 0;
1342 1341
1343 ssize = size + bytes_align; 1342 buf->vaddr =
1344 buf->vaddr = dma_alloc_coherent(dev, ssize, &paddr, GFP_DMA | 1343 dma_alloc_coherent(dev, size + bytes_align, &buf->paddr,
1345 __GFP_ZERO); 1344 GFP_DMA | __GFP_ZERO);
1346 if (!buf->vaddr) 1345 if (!buf->vaddr)
1347 return -ENOMEM; 1346 return -ENOMEM;
1348 1347
1349 buf->paddr = (__u32) paddr;
1350
1351 mask = bytes_align - 1; 1348 mask = bytes_align - 1;
1352 offset = (u32)buf->paddr & mask; 1349 offset = buf->paddr & mask;
1353 if (offset) { 1350 if (offset) {
1354 buf->offset = bytes_align - offset; 1351 buf->offset = bytes_align - offset;
1355 buf->paddr = (u32)buf->paddr + offset; 1352 buf->paddr = buf->paddr + offset;
1356 } else 1353 } else
1357 buf->offset = 0; 1354 buf->offset = 0;
1358 1355