提交 00a0af9a 编写于 作者: H Hyun Kwon 提交者: Bartlomiej Zolnierkiewicz

video: fbdev: Fix multiple style issues in xilinxfb

All reported by from checkpatch
./scripts/checkpatch.pl --max-line-length 120 -strict -f
drivers/video/fbdev/xilinxfb.c

WARNING: Block comments should align the * on each line
WARNING: Block comments use a trailing */ on a separate line
WARNING: Block comments use * on subsequent lines
WARNING: please, no space before tabs
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: braces {} are not necessary for single statement blocks
WARNING: Missing a blank line after declarations
WARNING: struct of_device_id should normally be const
CHECK: Please don't use multiple blank lines
CHECK: Blank lines aren't necessary after an open brace '{'
CHECK: Alignment should match open parenthesis
CHECK: 'Endianess' may be misspelled - perhaps 'Endianness'?
CHECK: spaces preferred around that '*' (ctx:VxV)
ERROR: that open brace { should be on the previous line
Signed-off-by: NHyun Kwon <hyun.kwon@xilinx.com>
Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
Cc: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
上级 69de8496
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#define DRIVER_NAME "xilinxfb" #define DRIVER_NAME "xilinxfb"
/* /*
* Xilinx calls it "TFT LCD Controller" though it can also be used for * Xilinx calls it "TFT LCD Controller" though it can also be used for
* the VGA port on the Xilinx ML40x board. This is a hardware display * the VGA port on the Xilinx ML40x board. This is a hardware display
...@@ -93,7 +92,8 @@ struct xilinxfb_platform_data { ...@@ -93,7 +92,8 @@ struct xilinxfb_platform_data {
/* Physical address of framebuffer memory; If non-zero, driver /* Physical address of framebuffer memory; If non-zero, driver
* will use provided memory address instead of allocating one from * will use provided memory address instead of allocating one from
* the consistent pool. */ * the consistent pool.
*/
u32 fb_phys; u32 fb_phys;
}; };
...@@ -128,18 +128,18 @@ static const struct fb_var_screeninfo xilinx_fb_var = { ...@@ -128,18 +128,18 @@ static const struct fb_var_screeninfo xilinx_fb_var = {
.activate = FB_ACTIVATE_NOW .activate = FB_ACTIVATE_NOW
}; };
#define BUS_ACCESS_FLAG 0x1 /* 1 = BUS, 0 = DCR */ #define BUS_ACCESS_FLAG 0x1 /* 1 = BUS, 0 = DCR */
#define LITTLE_ENDIAN_ACCESS 0x2 /* LITTLE ENDIAN IO functions */ #define LITTLE_ENDIAN_ACCESS 0x2 /* LITTLE ENDIAN IO functions */
struct xilinxfb_drvdata { struct xilinxfb_drvdata {
struct fb_info info; /* FB driver info record */ struct fb_info info; /* FB driver info record */
phys_addr_t regs_phys; /* phys. address of the control phys_addr_t regs_phys; /* phys. address of the control
registers */ * registers
*/
void __iomem *regs; /* virt. address of the control void __iomem *regs; /* virt. address of the control
registers */ * registers
*/
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
dcr_host_t dcr_host; dcr_host_t dcr_host;
unsigned int dcr_len; unsigned int dcr_len;
...@@ -195,8 +195,8 @@ static u32 xilinx_fb_in32(struct xilinxfb_drvdata *drvdata, u32 offset) ...@@ -195,8 +195,8 @@ static u32 xilinx_fb_in32(struct xilinxfb_drvdata *drvdata, u32 offset)
} }
static int static int
xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, xilinx_fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green,
unsigned transp, struct fb_info *fbi) unsigned int blue, unsigned int transp, struct fb_info *fbi)
{ {
u32 *palette = fbi->pseudo_palette; u32 *palette = fbi->pseudo_palette;
...@@ -205,9 +205,11 @@ xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, ...@@ -205,9 +205,11 @@ xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue,
if (fbi->var.grayscale) { if (fbi->var.grayscale) {
/* Convert color to grayscale. /* Convert color to grayscale.
* grayscale = 0.30*R + 0.59*G + 0.11*B */ * grayscale = 0.30*R + 0.59*G + 0.11*B
red = green = blue = */
(red * 77 + green * 151 + blue * 28 + 127) >> 8; blue = (red * 77 + green * 151 + blue * 28 + 127) >> 8;
green = blue;
red = green;
} }
/* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */ /* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */
...@@ -241,13 +243,11 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi) ...@@ -241,13 +243,11 @@ xilinx_fb_blank(int blank_mode, struct fb_info *fbi)
xilinx_fb_out32(drvdata, REG_CTRL, 0); xilinx_fb_out32(drvdata, REG_CTRL, 0);
default: default:
break; break;
} }
return 0; /* success */ return 0; /* success */
} }
static struct fb_ops xilinxfb_ops = static struct fb_ops xilinxfb_ops = {
{
.owner = THIS_MODULE, .owner = THIS_MODULE,
.fb_setcolreg = xilinx_fb_setcolreg, .fb_setcolreg = xilinx_fb_setcolreg,
.fb_blank = xilinx_fb_blank, .fb_blank = xilinx_fb_blank,
...@@ -286,7 +286,8 @@ static int xilinxfb_assign(struct platform_device *pdev, ...@@ -286,7 +286,8 @@ static int xilinxfb_assign(struct platform_device *pdev,
} else { } else {
drvdata->fb_alloced = 1; drvdata->fb_alloced = 1;
drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
&drvdata->fb_phys, GFP_KERNEL); &drvdata->fb_phys,
GFP_KERNEL);
} }
if (!drvdata->fb_virt) { if (!drvdata->fb_virt) {
...@@ -300,7 +301,7 @@ static int xilinxfb_assign(struct platform_device *pdev, ...@@ -300,7 +301,7 @@ static int xilinxfb_assign(struct platform_device *pdev,
/* Tell the hardware where the frame buffer is */ /* Tell the hardware where the frame buffer is */
xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
rc = xilinx_fb_in32(drvdata, REG_FB_ADDR); rc = xilinx_fb_in32(drvdata, REG_FB_ADDR);
/* Endianess detection */ /* Endianness detection */
if (rc != drvdata->fb_phys) { if (rc != drvdata->fb_phys) {
drvdata->flags |= LITTLE_ENDIAN_ACCESS; drvdata->flags |= LITTLE_ENDIAN_ACCESS;
xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
...@@ -310,8 +311,7 @@ static int xilinxfb_assign(struct platform_device *pdev, ...@@ -310,8 +311,7 @@ static int xilinxfb_assign(struct platform_device *pdev,
drvdata->reg_ctrl_default = REG_CTRL_ENABLE; drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
if (pdata->rotate_screen) if (pdata->rotate_screen)
drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
xilinx_fb_out32(drvdata, REG_CTRL, xilinx_fb_out32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
drvdata->reg_ctrl_default);
/* Fill struct fb_info */ /* Fill struct fb_info */
drvdata->info.device = dev; drvdata->info.device = dev;
...@@ -435,12 +435,12 @@ static int xilinxfb_of_probe(struct platform_device *pdev) ...@@ -435,12 +435,12 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
* Fill the resource structure if its direct BUS interface * Fill the resource structure if its direct BUS interface
* otherwise fill the dcr_host structure. * otherwise fill the dcr_host structure.
*/ */
if (tft_access) { if (tft_access)
drvdata->flags |= BUS_ACCESS_FLAG; drvdata->flags |= BUS_ACCESS_FLAG;
}
#ifdef CONFIG_PPC_DCR #ifdef CONFIG_PPC_DCR
else { else {
int start; int start;
start = dcr_resource_start(pdev->dev.of_node, 0); start = dcr_resource_start(pdev->dev.of_node, 0);
drvdata->dcr_len = dcr_resource_len(pdev->dev.of_node, 0); drvdata->dcr_len = dcr_resource_len(pdev->dev.of_node, 0);
drvdata->dcr_host = dcr_map(pdev->dev.of_node, start, drvdata->dcr_len); drvdata->dcr_host = dcr_map(pdev->dev.of_node, start, drvdata->dcr_len);
...@@ -452,19 +452,19 @@ static int xilinxfb_of_probe(struct platform_device *pdev) ...@@ -452,19 +452,19 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
#endif #endif
prop = of_get_property(pdev->dev.of_node, "phys-size", &size); prop = of_get_property(pdev->dev.of_node, "phys-size", &size);
if ((prop) && (size >= sizeof(u32)*2)) { if ((prop) && (size >= sizeof(u32) * 2)) {
pdata.screen_width_mm = prop[0]; pdata.screen_width_mm = prop[0];
pdata.screen_height_mm = prop[1]; pdata.screen_height_mm = prop[1];
} }
prop = of_get_property(pdev->dev.of_node, "resolution", &size); prop = of_get_property(pdev->dev.of_node, "resolution", &size);
if ((prop) && (size >= sizeof(u32)*2)) { if ((prop) && (size >= sizeof(u32) * 2)) {
pdata.xres = prop[0]; pdata.xres = prop[0];
pdata.yres = prop[1]; pdata.yres = prop[1];
} }
prop = of_get_property(pdev->dev.of_node, "virtual-resolution", &size); prop = of_get_property(pdev->dev.of_node, "virtual-resolution", &size);
if ((prop) && (size >= sizeof(u32)*2)) { if ((prop) && (size >= sizeof(u32) * 2)) {
pdata.xvirt = prop[0]; pdata.xvirt = prop[0];
pdata.yvirt = prop[1]; pdata.yvirt = prop[1];
} }
...@@ -482,7 +482,7 @@ static int xilinxfb_of_remove(struct platform_device *op) ...@@ -482,7 +482,7 @@ static int xilinxfb_of_remove(struct platform_device *op)
} }
/* Match table for of_platform binding */ /* Match table for of_platform binding */
static struct of_device_id xilinxfb_of_match[] = { static const struct of_device_id xilinxfb_of_match[] = {
{ .compatible = "xlnx,xps-tft-1.00.a", }, { .compatible = "xlnx,xps-tft-1.00.a", },
{ .compatible = "xlnx,xps-tft-2.00.a", }, { .compatible = "xlnx,xps-tft-2.00.a", },
{ .compatible = "xlnx,xps-tft-2.01.a", }, { .compatible = "xlnx,xps-tft-2.01.a", },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册