aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fsl-diu-fb.c
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-09-15 16:44:52 -0500
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-09-18 20:08:57 +0000
commitbada04fcda8bd2a2bfd5519a6a7265ec9896b435 (patch)
tree842b107a958196c0734578c91f7d1ad4e3d66157 /drivers/video/fsl-diu-fb.c
parentdrivers/video: fsl-diu-fb: remove redundant default video mode (diff)
downloadlinux-dev-bada04fcda8bd2a2bfd5519a6a7265ec9896b435.tar.xz
linux-dev-bada04fcda8bd2a2bfd5519a6a7265ec9896b435.zip
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)
static int request_irq_local(int irq)
{
- unsigned long status, ints;
+ u32 ints;
struct diu *hw;
int ret;
hw = dr.diu_reg;
/* 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);
if (!ret) {
@@ -1285,7 +1285,7 @@ static int request_irq_local(int irq)
ints |= INT_VSYNC_WB;
/* Read to clear the status */
- status = in_be32(&hw->int_status);
+ in_be32(&hw->int_status);
out_be32(&hw->int_mask, ints);
}
@@ -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,
u32 bytes_align)
{
- u32 offset, ssize;
- u32 mask;
- dma_addr_t paddr = 0;
+ u32 offset;
+ dma_addr_t mask;
- ssize = size + bytes_align;
- buf->vaddr = dma_alloc_coherent(dev, ssize, &paddr, GFP_DMA |
- __GFP_ZERO);
+ buf->vaddr =
+ dma_alloc_coherent(dev, size + bytes_align, &buf->paddr,
+ GFP_DMA | __GFP_ZERO);
if (!buf->vaddr)
return -ENOMEM;
- buf->paddr = (__u32) paddr;
-
mask = bytes_align - 1;
- offset = (u32)buf->paddr & mask;
+ offset = buf->paddr & mask;
if (offset) {
buf->offset = bytes_align - offset;
- buf->paddr = (u32)buf->paddr + offset;
+ buf->paddr = buf->paddr + offset;
} else
buf->offset = 0;