Commit 0ff1edee authored by Krzysztof Helt's avatar Krzysztof Helt Committed by Linus Torvalds

cirrusfb: code improvement 2nd part

This patch removes:
- redundant fields from the cirrusfb_regs structure
- one redundant header
- fixes two includes ("" to <>)
Signed-off-by: default avatarKrzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: default avatarAntonino Daplas <adaplas@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 060b6002
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/selection.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#ifdef CONFIG_ZORRO #ifdef CONFIG_ZORRO
...@@ -64,8 +63,8 @@ ...@@ -64,8 +63,8 @@
#define isPReP 0 #define isPReP 0
#endif #endif
#include "video/vga.h" #include <video/vga.h>
#include "video/cirrus.h" #include <video/cirrus.h>
/***************************************************************** /*****************************************************************
* *
...@@ -99,9 +98,6 @@ ...@@ -99,9 +98,6 @@
#endif #endif
#define MB_ (1024 * 1024) #define MB_ (1024 * 1024)
#define KB_ (1024)
#define MAX_NUM_BOARDS 7
/***************************************************************** /*****************************************************************
* *
...@@ -331,10 +327,6 @@ static const struct { ...@@ -331,10 +327,6 @@ static const struct {
#endif /* CONFIG_ZORRO */ #endif /* CONFIG_ZORRO */
struct cirrusfb_regs { struct cirrusfb_regs {
__u32 line_length; /* in BYTES! */
__u32 visual;
__u32 type;
long freq; long freq;
long nom; long nom;
long den; long den;
...@@ -525,7 +517,7 @@ static struct fb_ops cirrusfb_ops = { ...@@ -525,7 +517,7 @@ static struct fb_ops cirrusfb_ops = {
/*--- Hardware Specific Routines -------------------------------------------*/ /*--- Hardware Specific Routines -------------------------------------------*/
static int cirrusfb_decode_var(const struct fb_var_screeninfo *var, static int cirrusfb_decode_var(const struct fb_var_screeninfo *var,
struct cirrusfb_regs *regs, struct cirrusfb_regs *regs,
const struct fb_info *info); struct fb_info *info);
/*--- Internal routines ----------------------------------------------------*/ /*--- Internal routines ----------------------------------------------------*/
static void init_vgachip(struct fb_info *info); static void init_vgachip(struct fb_info *info);
static void switch_monitor(struct cirrusfb_info *cinfo, int on); static void switch_monitor(struct cirrusfb_info *cinfo, int on);
...@@ -792,7 +784,7 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var, ...@@ -792,7 +784,7 @@ static int cirrusfb_check_var(struct fb_var_screeninfo *var,
static int cirrusfb_decode_var(const struct fb_var_screeninfo *var, static int cirrusfb_decode_var(const struct fb_var_screeninfo *var,
struct cirrusfb_regs *regs, struct cirrusfb_regs *regs,
const struct fb_info *info) struct fb_info *info)
{ {
long freq; long freq;
long maxclock; long maxclock;
...@@ -803,20 +795,20 @@ static int cirrusfb_decode_var(const struct fb_var_screeninfo *var, ...@@ -803,20 +795,20 @@ static int cirrusfb_decode_var(const struct fb_var_screeninfo *var,
switch (var->bits_per_pixel) { switch (var->bits_per_pixel) {
case 1: case 1:
regs->line_length = var->xres_virtual / 8; info->fix.line_length = var->xres_virtual / 8;
regs->visual = FB_VISUAL_MONO10; info->fix.visual = FB_VISUAL_MONO10;
break; break;
case 8: case 8:
regs->line_length = var->xres_virtual; info->fix.line_length = var->xres_virtual;
regs->visual = FB_VISUAL_PSEUDOCOLOR; info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
break; break;
case 16: case 16:
case 24: case 24:
case 32: case 32:
regs->line_length = var->xres_virtual * maxclockidx; info->fix.line_length = var->xres_virtual * maxclockidx;
regs->visual = FB_VISUAL_DIRECTCOLOR; info->fix.visual = FB_VISUAL_DIRECTCOLOR;
break; break;
default: default:
...@@ -826,7 +818,7 @@ static int cirrusfb_decode_var(const struct fb_var_screeninfo *var, ...@@ -826,7 +818,7 @@ static int cirrusfb_decode_var(const struct fb_var_screeninfo *var,
break; break;
} }
regs->type = FB_TYPE_PACKED_PIXELS; info->fix.type = FB_TYPE_PACKED_PIXELS;
/* convert from ps to kHz */ /* convert from ps to kHz */
freq = PICOS2KHZ(var->pixclock); freq = PICOS2KHZ(var->pixclock);
...@@ -1539,9 +1531,6 @@ static int cirrusfb_set_par_foo(struct fb_info *info) ...@@ -1539,9 +1531,6 @@ static int cirrusfb_set_par_foo(struct fb_info *info)
DPRINTK("CL_SEQR1: %d\n", tmp); DPRINTK("CL_SEQR1: %d\n", tmp);
cinfo->currentmode = regs; cinfo->currentmode = regs;
info->fix.type = regs.type;
info->fix.visual = regs.visual;
info->fix.line_length = regs.line_length;
/* pan to requested offset */ /* pan to requested offset */
cirrusfb_pan_display(var, info); cirrusfb_pan_display(var, info);
...@@ -1622,7 +1611,7 @@ static int cirrusfb_pan_display(struct fb_var_screeninfo *var, ...@@ -1622,7 +1611,7 @@ static int cirrusfb_pan_display(struct fb_var_screeninfo *var,
xoffset = var->xoffset * info->var.bits_per_pixel / 8; xoffset = var->xoffset * info->var.bits_per_pixel / 8;
yoffset = var->yoffset; yoffset = var->yoffset;
base = yoffset * cinfo->currentmode.line_length + xoffset; base = yoffset * info->fix.line_length + xoffset;
if (info->var.bits_per_pixel == 1) { if (info->var.bits_per_pixel == 1) {
/* base is already correct */ /* base is already correct */
...@@ -2081,7 +2070,7 @@ static void cirrusfb_fillrect(struct fb_info *info, ...@@ -2081,7 +2070,7 @@ static void cirrusfb_fillrect(struct fb_info *info,
(region->dx * m) / 8, region->dy, (region->dx * m) / 8, region->dy,
(region->width * m) / 8, region->height, (region->width * m) / 8, region->height,
color, color,
cinfo->currentmode.line_length); info->fix.line_length);
} }
static void cirrusfb_copyarea(struct fb_info *info, static void cirrusfb_copyarea(struct fb_info *info,
...@@ -2121,7 +2110,7 @@ static void cirrusfb_copyarea(struct fb_info *info, ...@@ -2121,7 +2110,7 @@ static void cirrusfb_copyarea(struct fb_info *info,
(area->sx * m) / 8, area->sy, (area->sx * m) / 8, area->sy,
(area->dx * m) / 8, area->dy, (area->dx * m) / 8, area->dy,
(area->width * m) / 8, area->height, (area->width * m) / 8, area->height,
cinfo->currentmode.line_length); info->fix.line_length);
} }
...@@ -2281,13 +2270,10 @@ static int cirrusfb_set_fbinfo(struct fb_info *info) ...@@ -2281,13 +2270,10 @@ static int cirrusfb_set_fbinfo(struct fb_info *info)
info->fix.smem_len = info->screen_size; info->fix.smem_len = info->screen_size;
if (var->bits_per_pixel == 1) if (var->bits_per_pixel == 1)
info->fix.smem_len /= 4; info->fix.smem_len /= 4;
info->fix.type = cinfo->currentmode.type;
info->fix.type_aux = 0; info->fix.type_aux = 0;
info->fix.visual = cinfo->currentmode.visual;
info->fix.xpanstep = 1; info->fix.xpanstep = 1;
info->fix.ypanstep = 1; info->fix.ypanstep = 1;
info->fix.ywrapstep = 0; info->fix.ywrapstep = 0;
info->fix.line_length = cinfo->currentmode.line_length;
/* FIXME: map region at 0xB8000 if available, fill in here */ /* FIXME: map region at 0xB8000 if available, fill in here */
info->fix.mmio_len = 0; info->fix.mmio_len = 0;
...@@ -2446,7 +2432,7 @@ static int cirrusfb_pci_register(struct pci_dev *pdev, ...@@ -2446,7 +2432,7 @@ static int cirrusfb_pci_register(struct pci_dev *pdev,
cinfo->unmap = cirrusfb_pci_unmap; cinfo->unmap = cirrusfb_pci_unmap;
printk(KERN_INFO " RAM (%lu kB) at 0xx%lx, ", printk(KERN_INFO " RAM (%lu kB) at 0xx%lx, ",
info->screen_size / KB_, board_addr); info->screen_size >> 10, board_addr);
printk(KERN_INFO "Cirrus Logic chipset on PCI bus\n"); printk(KERN_INFO "Cirrus Logic chipset on PCI bus\n");
pci_set_drvdata(pdev, info); pci_set_drvdata(pdev, info);
...@@ -2520,7 +2506,6 @@ static int cirrusfb_zorro_register(struct zorro_dev *z, ...@@ -2520,7 +2506,6 @@ static int cirrusfb_zorro_register(struct zorro_dev *z,
} }
cinfo = info->par; cinfo = info->par;
cinfo->info = info;
cinfo->btype = btype; cinfo->btype = btype;
assert(z > 0); assert(z > 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