[CG6]: code cleanup
This patch: - corrects coding style errors pointed by Lindent and checkpatch - replaces space chunks with tabs - removes one redundant include - improves indentations of defines - removes from comments leftovers from skeletonfb - adds __devinit attribute to two init functions Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
d773b33972
commit
6993bea1b6
@@ -19,7 +19,6 @@
|
||||
#include <linux/mm.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/prom.h>
|
||||
#include <asm/of_device.h>
|
||||
#include <asm/fbio.h>
|
||||
|
||||
@@ -281,9 +280,7 @@ static int cg6_sync(struct fb_info *info)
|
||||
}
|
||||
|
||||
/**
|
||||
* cg6_fillrect - REQUIRED function. Can use generic routines if
|
||||
* non acclerated hardware and packed pixel based.
|
||||
* Draws a rectangle on the screen.
|
||||
* cg6_fillrect - Draws a rectangle on the screen.
|
||||
*
|
||||
* @info: frame buffer structure that represents a single frame buffer
|
||||
* @rect: structure defining the rectagle and operation.
|
||||
@@ -316,9 +313,7 @@ static void cg6_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
|
||||
}
|
||||
|
||||
/**
|
||||
* cg6_imageblit - REQUIRED function. Can use generic routines if
|
||||
* non acclerated hardware and packed pixel based.
|
||||
* Copies a image from system memory to the screen.
|
||||
* cg6_imageblit - Copies a image from system memory to the screen.
|
||||
*
|
||||
* @info: frame buffer structure that represents a single frame buffer
|
||||
* @image: structure defining the image.
|
||||
@@ -404,7 +399,8 @@ static void cg6_imageblit(struct fb_info *info, const struct fb_image *image)
|
||||
}
|
||||
|
||||
/**
|
||||
* cg6_setcolreg - Optional function. Sets a color register.
|
||||
* cg6_setcolreg - Sets a color register.
|
||||
*
|
||||
* @regno: boolean, 0 copy local, 1 get_user() function
|
||||
* @red: frame buffer colormap structure
|
||||
* @green: The green value which can be up to 16 bits wide
|
||||
@@ -440,12 +436,12 @@ static int cg6_setcolreg(unsigned regno,
|
||||
}
|
||||
|
||||
/**
|
||||
* cg6_blank - Optional function. Blanks the display.
|
||||
* cg6_blank - Blanks the display.
|
||||
*
|
||||
* @blank_mode: the blank mode we want.
|
||||
* @info: frame buffer structure that represents a single frame buffer
|
||||
*/
|
||||
static int
|
||||
cg6_blank(int blank, struct fb_info *info)
|
||||
static int cg6_blank(int blank, struct fb_info *info)
|
||||
{
|
||||
struct cg6_par *par = (struct cg6_par *)info->par;
|
||||
struct cg6_thc __iomem *thc = par->thc;
|
||||
@@ -453,12 +449,11 @@ cg6_blank(int blank, struct fb_info *info)
|
||||
u32 val;
|
||||
|
||||
spin_lock_irqsave(&par->lock, flags);
|
||||
val = sbus_readl(&thc->thc_misc);
|
||||
|
||||
switch (blank) {
|
||||
case FB_BLANK_UNBLANK: /* Unblanking */
|
||||
val = sbus_readl(&thc->thc_misc);
|
||||
val |= CG6_THC_MISC_VIDEO;
|
||||
sbus_writel(val, &thc->thc_misc);
|
||||
par->flags &= ~CG6_FLAG_BLANKED;
|
||||
break;
|
||||
|
||||
@@ -466,13 +461,12 @@ cg6_blank(int blank, struct fb_info *info)
|
||||
case FB_BLANK_VSYNC_SUSPEND: /* VESA blank (vsync off) */
|
||||
case FB_BLANK_HSYNC_SUSPEND: /* VESA blank (hsync off) */
|
||||
case FB_BLANK_POWERDOWN: /* Poweroff */
|
||||
val = sbus_readl(&thc->thc_misc);
|
||||
val &= ~CG6_THC_MISC_VIDEO;
|
||||
sbus_writel(val, &thc->thc_misc);
|
||||
par->flags |= CG6_FLAG_BLANKED;
|
||||
break;
|
||||
}
|
||||
|
||||
sbus_writel(val, &thc->thc_misc);
|
||||
spin_unlock_irqrestore(&par->lock, flags);
|
||||
|
||||
return 0;
|
||||
@@ -543,8 +537,7 @@ static int cg6_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
|
||||
* Initialisation
|
||||
*/
|
||||
|
||||
static void
|
||||
cg6_init_fix(struct fb_info *info, int linebytes)
|
||||
static void __devinit cg6_init_fix(struct fb_info *info, int linebytes)
|
||||
{
|
||||
struct cg6_par *par = (struct cg6_par *)info->par;
|
||||
const char *cg6_cpu_name, *cg6_card_name;
|
||||
@@ -563,18 +556,16 @@ cg6_init_fix(struct fb_info *info, int linebytes)
|
||||
break;
|
||||
};
|
||||
if (((conf >> CG6_FHC_REV_SHIFT) & CG6_FHC_REV_MASK) >= 11) {
|
||||
if (par->fbsize <= 0x100000) {
|
||||
if (par->fbsize <= 0x100000)
|
||||
cg6_card_name = "TGX";
|
||||
} else {
|
||||
else
|
||||
cg6_card_name = "TGX+";
|
||||
}
|
||||
} else {
|
||||
if (par->fbsize <= 0x100000) {
|
||||
if (par->fbsize <= 0x100000)
|
||||
cg6_card_name = "GX";
|
||||
} else {
|
||||
else
|
||||
cg6_card_name = "GX+";
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(info->fix.id, "%s %s", cg6_card_name, cg6_cpu_name);
|
||||
info->fix.id[sizeof(info->fix.id) - 1] = 0;
|
||||
@@ -588,7 +579,7 @@ cg6_init_fix(struct fb_info *info, int linebytes)
|
||||
}
|
||||
|
||||
/* Initialize Brooktree DAC */
|
||||
static void cg6_bt_init(struct cg6_par *par)
|
||||
static void __devinit cg6_bt_init(struct cg6_par *par)
|
||||
{
|
||||
struct bt_regs __iomem *bt = par->bt;
|
||||
|
||||
@@ -602,7 +593,7 @@ static void cg6_bt_init(struct cg6_par *par)
|
||||
sbus_writel(0x00 << 24, &bt->control);
|
||||
}
|
||||
|
||||
static void cg6_chip_init(struct fb_info *info)
|
||||
static void __devinit cg6_chip_init(struct fb_info *info)
|
||||
{
|
||||
struct cg6_par *par = (struct cg6_par *)info->par;
|
||||
struct cg6_tec __iomem *tec = par->tec;
|
||||
@@ -671,7 +662,8 @@ static void cg6_unmap_regs(struct of_device *op, struct fb_info *info,
|
||||
of_iounmap(&op->resource[0], info->screen_base, par->fbsize);
|
||||
}
|
||||
|
||||
static int __devinit cg6_probe(struct of_device *op, const struct of_device_id *match)
|
||||
static int __devinit cg6_probe(struct of_device *op,
|
||||
const struct of_device_id *match)
|
||||
{
|
||||
struct device_node *dp = op->node;
|
||||
struct fb_info *info;
|
||||
|
Reference in New Issue
Block a user