From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY
Date: Tue, 04 May 2010 12:58:06 -0600 [thread overview]
Message-ID: <20100504185806.7244.96960.stgit@bob.kio> (raw)
In-Reply-To: <20100504185801.7244.39173.stgit@bob.kio>
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;
}
}
next prev parent reply other threads:[~2010-05-04 18:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-04 18:58 [PATCH 1/2] resources: fill in type for __request_region() Bjorn Helgaas
2010-05-04 18:58 ` Bjorn Helgaas [this message]
2010-05-04 19:09 ` [PATCH 2/2] vgacon: use request_region(), not request_resource(), to set BUSY Linus Torvalds
2010-05-04 19:16 ` Bjorn Helgaas
2010-05-04 20:14 ` H. Peter Anvin
2010-05-04 20:51 ` Jesse Barnes
2010-05-18 21:41 ` Jesse Barnes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100504185806.7244.96960.stgit@bob.kio \
--to=bjorn.helgaas@hp.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox