Commit bada04fc authored by Timur Tabi's avatar Timur Tabi Committed by Florian Tobias Schandinat

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: default avatarTimur Tabi <timur@freescale.com>
Signed-off-by: default avatarFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
parent 63cf8df4
...@@ -1265,14 +1265,14 @@ static irqreturn_t fsl_diu_isr(int irq, void *dev_id) ...@@ -1265,14 +1265,14 @@ static irqreturn_t fsl_diu_isr(int irq, void *dev_id)
static int request_irq_local(int irq) static int request_irq_local(int irq)
{ {
unsigned long status, ints; u32 ints;
struct diu *hw; struct diu *hw;
int ret; int ret;
hw = dr.diu_reg; hw = dr.diu_reg;
/* Read to clear the status */ /* Read to clear the status */
status = in_be32(&hw->int_status); in_be32(&hw->int_status);
ret = request_irq(irq, fsl_diu_isr, 0, "diu", NULL); ret = request_irq(irq, fsl_diu_isr, 0, "diu", NULL);
if (!ret) { if (!ret) {
...@@ -1285,7 +1285,7 @@ static int request_irq_local(int irq) ...@@ -1285,7 +1285,7 @@ static int request_irq_local(int irq)
ints |= INT_VSYNC_WB; ints |= INT_VSYNC_WB;
/* Read to clear the status */ /* Read to clear the status */
status = in_be32(&hw->int_status); in_be32(&hw->int_status);
out_be32(&hw->int_mask, ints); out_be32(&hw->int_mask, ints);
} }
...@@ -1336,23 +1336,20 @@ static int fsl_diu_resume(struct platform_device *ofdev) ...@@ -1336,23 +1336,20 @@ static int fsl_diu_resume(struct platform_device *ofdev)
static int allocate_buf(struct device *dev, struct diu_addr *buf, u32 size, static int allocate_buf(struct device *dev, struct diu_addr *buf, u32 size,
u32 bytes_align) u32 bytes_align)
{ {
u32 offset, ssize; u32 offset;
u32 mask; dma_addr_t mask;
dma_addr_t paddr = 0;
ssize = size + bytes_align; buf->vaddr =
buf->vaddr = dma_alloc_coherent(dev, ssize, &paddr, GFP_DMA | dma_alloc_coherent(dev, size + bytes_align, &buf->paddr,
__GFP_ZERO); GFP_DMA | __GFP_ZERO);
if (!buf->vaddr) if (!buf->vaddr)
return -ENOMEM; return -ENOMEM;
buf->paddr = (__u32) paddr;
mask = bytes_align - 1; mask = bytes_align - 1;
offset = (u32)buf->paddr & mask; offset = buf->paddr & mask;
if (offset) { if (offset) {
buf->offset = bytes_align - offset; buf->offset = bytes_align - offset;
buf->paddr = (u32)buf->paddr + offset; buf->paddr = buf->paddr + offset;
} else } else
buf->offset = 0; buf->offset = 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