Commit 482e7b83 authored by Rob Radez's avatar Rob Radez Committed by David S. Miller

[SPARC32]: Fix build in several spots.

- Protect subsys_initcall in pcic.c with CONFIG_PCI
- MINOR-->minor in sbus drivers
- Fix sbus fb build for bwtwo/leo/tcx.
parent d999bb3d
......@@ -226,6 +226,8 @@ source drivers/input/Config.in
source fs/Config.in
mainmenu_option next_comment
comment 'Sound card support'
tristate 'Sound card support' CONFIG_SOUND
if [ "$CONFIG_SOUND" != "n" ]; then
source sound/Config.in
......
......@@ -1031,6 +1031,6 @@ void insl(unsigned long addr, void *dst, unsigned long count) {
}
}
#endif
subsys_initcall(pcic_init);
#endif
......@@ -439,7 +439,7 @@ static spinlock_t bpp_open_lock = SPIN_LOCK_UNLOCKED;
*/
static int bpp_open(struct inode *inode, struct file *f)
{
unsigned minor = MINOR(inode->i_rdev);
unsigned minor = minor(inode->i_rdev);
int ret;
spin_lock(&bpp_open_lock);
......@@ -469,7 +469,7 @@ static int bpp_open(struct inode *inode, struct file *f)
*/
static int bpp_release(struct inode *inode, struct file *f)
{
unsigned minor = MINOR(inode->i_rdev);
unsigned minor = minor(inode->i_rdev);
spin_lock(&bpp_open_lock);
instances[minor].opened = 0;
......@@ -633,7 +633,7 @@ static long read_ecp(unsigned minor, char *c, unsigned long cnt)
static ssize_t bpp_read(struct file *f, char *c, size_t cnt, loff_t * ppos)
{
long rc;
const unsigned minor = MINOR(f->f_dentry->d_inode->i_rdev);
const unsigned minor = minor(f->f_dentry->d_inode->i_rdev);
if (minor >= BPP_NO) return -ENODEV;
if (!instances[minor].present) return -ENODEV;
......@@ -786,7 +786,7 @@ static long write_ecp(unsigned minor, const char *c, unsigned long cnt)
static ssize_t bpp_write(struct file *f, const char *c, size_t cnt, loff_t * ppos)
{
long errno = 0;
const unsigned minor = MINOR(f->f_dentry->d_inode->i_rdev);
const unsigned minor = minor(f->f_dentry->d_inode->i_rdev);
if (minor >= BPP_NO) return -ENODEV;
if (!instances[minor].present) return -ENODEV;
......@@ -812,7 +812,7 @@ static int bpp_ioctl(struct inode *inode, struct file *f, unsigned int cmd,
{
int errno = 0;
unsigned minor = MINOR(inode->i_rdev);
unsigned minor = minor(inode->i_rdev);
if (minor >= BPP_NO) return -ENODEV;
if (!instances[minor].present) return -ENODEV;
......
......@@ -113,7 +113,7 @@ static void bw2_margins (struct fb_info_sbusfb *fb, struct display *p,
int x_margin, int y_margin)
{
fb->info.screen_base += (y_margin - fb->y_margin) *
p->line_length + ((x_margin - fb->x_margin) >> 3);
p->fb_info->fix.line_length + ((x_margin - fb->x_margin) >> 3);
}
static u8 bw2regs_1600[] __initdata = {
......@@ -155,7 +155,7 @@ static char idstring[60] __initdata = { 0 };
char __init *bwtwofb_init(struct fb_info_sbusfb *fb)
{
struct fb_fix_screeninfo *fix = &fb->fix;
struct fb_fix_screeninfo *fix = &fb->info.fix;
struct display *disp = &fb->disp;
struct fbtype *type = &fb->type;
#ifdef CONFIG_SUN4
......@@ -232,7 +232,7 @@ char __init *bwtwofb_init(struct fb_info_sbusfb *fb)
strcpy(fb->info.modename, "BWtwo");
strcpy(fix->id, "BWtwo");
fix->line_length = fb->var.xres_virtual >> 3;
fix->line_length = fb->info.var.xres_virtual >> 3;
fix->accel = FB_ACCEL_SUN_BWTWO;
disp->scrollmode = SCROLL_YREDRAW;
......
......@@ -258,7 +258,7 @@ static void leo_putc(struct vc_data *conp, struct display *p, int c, int yy, int
sbus_writel(attr_bgcol(p,c) << 24, &ss->bg);
sbus_writel(0xFFFFFFFF<<(32-fontwidth(p)),
&us->fontmsk);
u = ((u32 *)p->fb_info.screen_base) + y + x;
u = ((u32 *)fb->info.screen_base) + y + x;
if (fontwidth(p) <= 8) {
for (i = 0; i < fontheight(p); i++, u += 2048) {
u32 val = *fd++ << 24;
......@@ -304,7 +304,7 @@ static void leo_putcs(struct vc_data *conp, struct display *p, const unsigned sh
y = yy << (fontheightlog(p) + 11);
else
y = (yy * fontheight(p)) << 11;
u = ((u32 *)p->fb_info.screen_base) + y + x;
u = ((u32 *)fb->info.screen_base) + y + x;
if (fontwidth(p) <= 8) {
sbus_writel(0xFFFFFFFF<<(32-4*fontwidth(p)), &us->fontmsk);
x = 4*fontwidth(p) - fontheight(p)*2048;
......@@ -594,7 +594,7 @@ leo_wid_put (struct fb_info_sbusfb *fb, struct fb_wid_list *wl)
static void leo_margins (struct fb_info_sbusfb *fb, struct display *p, int x_margin, int y_margin)
{
fb->fb_info.screen_base += 8192 * (y_margin - fb->y_margin) + 4 * (x_margin - fb->x_margin);
fb->info.screen_base += 8192 * (y_margin - fb->y_margin) + 4 * (x_margin - fb->x_margin);
}
static void leo_switch_from_graph (struct fb_info_sbusfb *fb)
......@@ -640,8 +640,8 @@ static char idstring[40] __initdata = { 0 };
char * __init leofb_init(struct fb_info_sbusfb *fb)
{
struct fb_fix_screeninfo *fix = &fb->fix;
struct fb_var_screeninfo *var = &fb->var;
struct fb_fix_screeninfo *fix = &fb->info.fix;
struct fb_var_screeninfo *var = &fb->info.var;
struct display *disp = &fb->disp;
struct fbtype *type = &fb->type;
struct sbus_dev *sdev = fb->sbdp;
......
......@@ -253,14 +253,14 @@ static void tcx_reset (struct fb_info_sbusfb *fb)
static void tcx_margins (struct fb_info_sbusfb *fb, struct display *p, int x_margin, int y_margin)
{
fb->info.screen_base += (y_margin - fb->y_margin) * p->line_length + (x_margin - fb->x_margin);
fb->info.screen_base += (y_margin - fb->y_margin) * p->fb_info->fix.line_length + (x_margin - fb->x_margin);
}
static char idstring[60] __initdata = { 0 };
char __init *tcxfb_init(struct fb_info_sbusfb *fb)
{
struct fb_fix_screeninfo *fix = &fb->fix;
struct fb_fix_screeninfo *fix = &fb->info.fix;
struct display *disp = &fb->disp;
struct fbtype *type = &fb->type;
struct sbus_dev *sdev = fb->sbdp;
......@@ -280,7 +280,7 @@ char __init *tcxfb_init(struct fb_info_sbusfb *fb)
strcpy(fb->info.modename, "TCX24");
strcpy(fix->id, "TCX24");
}
fix->line_length = fb->var.xres_virtual;
fix->line_length = fb->info.var.xres_virtual;
fix->accel = FB_ACCEL_SUN_TCX;
disp->scrollmode = SCROLL_YREDRAW;
......
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