lkml.org 
[lkml]   [2010]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY
From
Date

Drivers normally use request_region() to mark the region busy so it won't
be used by anybody else. Previously, we used request_resource(), which
doesn't mark the VGA regions busy.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
---

drivers/video/console/vgacon.c | 30 ++++++------------------------
1 files changed, 6 insertions(+), 24 deletions(-)


diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 182dd6f..fca54ec 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -410,25 +410,16 @@ static const char *vgacon_startup(void)
vga_video_port_reg = VGA_CRT_IM;
vga_video_port_val = VGA_CRT_DM;
if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
- static struct resource ega_console_resource =
- { .name = "ega", .start = 0x3B0, .end = 0x3BF };
vga_video_type = VIDEO_TYPE_EGAM;
vga_vram_size = 0x8000;
display_desc = "EGA+";
- request_resource(&ioport_resource,
- &ega_console_resource);
+ request_region(0x3b0, 0x10, "ega");
} else {
- static struct resource mda1_console_resource =
- { .name = "mda", .start = 0x3B0, .end = 0x3BB };
- static struct resource mda2_console_resource =
- { .name = "mda", .start = 0x3BF, .end = 0x3BF };
vga_video_type = VIDEO_TYPE_MDA;
vga_vram_size = 0x2000;
display_desc = "*MDA";
- request_resource(&ioport_resource,
- &mda1_console_resource);
- request_resource(&ioport_resource,
- &mda2_console_resource);
+ request_region(0x3b0, 0xc, "mda");
+ request_region(0x3bf, 0x1, "mda");
vga_video_font_height = 14;
}
} else {
@@ -443,19 +434,13 @@ static const char *vgacon_startup(void)
vga_vram_size = 0x8000;

if (!screen_info.orig_video_isVGA) {
- static struct resource ega_console_resource
- = { .name = "ega", .start = 0x3C0, .end = 0x3DF };
vga_video_type = VIDEO_TYPE_EGAC;
display_desc = "EGA";
- request_resource(&ioport_resource,
- &ega_console_resource);
+ request_region(0x3c0, 0x20, "ega");
} else {
- static struct resource vga_console_resource
- = { .name = "vga+", .start = 0x3C0, .end = 0x3DF };
vga_video_type = VIDEO_TYPE_VGAC;
display_desc = "VGA+";
- request_resource(&ioport_resource,
- &vga_console_resource);
+ request_region(0x3c0, 0x20, "vga+");

#ifdef VGA_CAN_DO_64KB
/*
@@ -494,13 +479,10 @@ static const char *vgacon_startup(void)
}
}
} else {
- static struct resource cga_console_resource =
- { .name = "cga", .start = 0x3D4, .end = 0x3D5 };
vga_video_type = VIDEO_TYPE_CGA;
vga_vram_size = 0x2000;
display_desc = "*CGA";
- request_resource(&ioport_resource,
- &cga_console_resource);
+ request_region(0x3d4, 0x2, "cga");
vga_video_font_height = 8;
}
}


\
 
 \ /
  Last update: 2010-05-04 21:01    [W:0.035 / U:27.872 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site