Skip to content

Commit c820841

Browse files
committed
vgacon: Set VGA struct resource types
Set the resource type when we reserve VGA-related I/O port resources. The resource code doesn't actually look at the type, so it inserts resources without a type in the tree correctly even without this change. But if we ever print a resource without a type, it looks like this: vga+ [??? 0x000003c0-0x000003df flags 0x0] Setting the type means it will be printed correctly as: vga+ [io 0x000003c0-0x000003df] Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 116a606 commit c820841

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

arch/alpha/kernel/console.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
struct pci_controller *pci_vga_hose;
2222
static struct resource alpha_vga = {
2323
.name = "alpha-vga+",
24+
.flags = IORESOURCE_IO,
2425
.start = 0x3C0,
2526
.end = 0x3DF
2627
};

drivers/video/console/vgacon.c

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -422,17 +422,26 @@ static const char *vgacon_startup(void)
422422
vga_video_port_val = VGA_CRT_DM;
423423
if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
424424
static struct resource ega_console_resource =
425-
{ .name = "ega", .start = 0x3B0, .end = 0x3BF };
425+
{ .name = "ega",
426+
.flags = IORESOURCE_IO,
427+
.start = 0x3B0,
428+
.end = 0x3BF };
426429
vga_video_type = VIDEO_TYPE_EGAM;
427430
vga_vram_size = 0x8000;
428431
display_desc = "EGA+";
429432
request_resource(&ioport_resource,
430433
&ega_console_resource);
431434
} else {
432435
static struct resource mda1_console_resource =
433-
{ .name = "mda", .start = 0x3B0, .end = 0x3BB };
436+
{ .name = "mda",
437+
.flags = IORESOURCE_IO,
438+
.start = 0x3B0,
439+
.end = 0x3BB };
434440
static struct resource mda2_console_resource =
435-
{ .name = "mda", .start = 0x3BF, .end = 0x3BF };
441+
{ .name = "mda",
442+
.flags = IORESOURCE_IO,
443+
.start = 0x3BF,
444+
.end = 0x3BF };
436445
vga_video_type = VIDEO_TYPE_MDA;
437446
vga_vram_size = 0x2000;
438447
display_desc = "*MDA";
@@ -454,15 +463,21 @@ static const char *vgacon_startup(void)
454463
vga_vram_size = 0x8000;
455464

456465
if (!screen_info.orig_video_isVGA) {
457-
static struct resource ega_console_resource
458-
= { .name = "ega", .start = 0x3C0, .end = 0x3DF };
466+
static struct resource ega_console_resource =
467+
{ .name = "ega",
468+
.flags = IORESOURCE_IO,
469+
.start = 0x3C0,
470+
.end = 0x3DF };
459471
vga_video_type = VIDEO_TYPE_EGAC;
460472
display_desc = "EGA";
461473
request_resource(&ioport_resource,
462474
&ega_console_resource);
463475
} else {
464-
static struct resource vga_console_resource
465-
= { .name = "vga+", .start = 0x3C0, .end = 0x3DF };
476+
static struct resource vga_console_resource =
477+
{ .name = "vga+",
478+
.flags = IORESOURCE_IO,
479+
.start = 0x3C0,
480+
.end = 0x3DF };
466481
vga_video_type = VIDEO_TYPE_VGAC;
467482
display_desc = "VGA+";
468483
request_resource(&ioport_resource,
@@ -494,7 +509,10 @@ static const char *vgacon_startup(void)
494509
}
495510
} else {
496511
static struct resource cga_console_resource =
497-
{ .name = "cga", .start = 0x3D4, .end = 0x3D5 };
512+
{ .name = "cga",
513+
.flags = IORESOURCE_IO,
514+
.start = 0x3D4,
515+
.end = 0x3D5 };
498516
vga_video_type = VIDEO_TYPE_CGA;
499517
vga_vram_size = 0x2000;
500518
display_desc = "*CGA";

0 commit comments

Comments
 (0)