Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+27 -8
+1
arch/alpha/kernel/console.c
··· 21 21 struct pci_controller *pci_vga_hose; 22 22 static struct resource alpha_vga = { 23 23 .name = "alpha-vga+", 24 + .flags = IORESOURCE_IO, 24 25 .start = 0x3C0, 25 26 .end = 0x3DF 26 27 };
+26 -8
drivers/video/console/vgacon.c
··· 422 422 vga_video_port_val = VGA_CRT_DM; 423 423 if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) { 424 424 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 }; 426 429 vga_video_type = VIDEO_TYPE_EGAM; 427 430 vga_vram_size = 0x8000; 428 431 display_desc = "EGA+"; ··· 433 430 &ega_console_resource); 434 431 } else { 435 432 static struct resource mda1_console_resource = 436 - { .name = "mda", .start = 0x3B0, .end = 0x3BB }; 433 + { .name = "mda", 434 + .flags = IORESOURCE_IO, 435 + .start = 0x3B0, 436 + .end = 0x3BB }; 437 437 static struct resource mda2_console_resource = 438 - { .name = "mda", .start = 0x3BF, .end = 0x3BF }; 438 + { .name = "mda", 439 + .flags = IORESOURCE_IO, 440 + .start = 0x3BF, 441 + .end = 0x3BF }; 439 442 vga_video_type = VIDEO_TYPE_MDA; 440 443 vga_vram_size = 0x2000; 441 444 display_desc = "*MDA"; ··· 463 454 vga_vram_size = 0x8000; 464 455 465 456 if (!screen_info.orig_video_isVGA) { 466 - static struct resource ega_console_resource 467 - = { .name = "ega", .start = 0x3C0, .end = 0x3DF }; 457 + static struct resource ega_console_resource = 458 + { .name = "ega", 459 + .flags = IORESOURCE_IO, 460 + .start = 0x3C0, 461 + .end = 0x3DF }; 468 462 vga_video_type = VIDEO_TYPE_EGAC; 469 463 display_desc = "EGA"; 470 464 request_resource(&ioport_resource, 471 465 &ega_console_resource); 472 466 } else { 473 - static struct resource vga_console_resource 474 - = { .name = "vga+", .start = 0x3C0, .end = 0x3DF }; 467 + static struct resource vga_console_resource = 468 + { .name = "vga+", 469 + .flags = IORESOURCE_IO, 470 + .start = 0x3C0, 471 + .end = 0x3DF }; 475 472 vga_video_type = VIDEO_TYPE_VGAC; 476 473 display_desc = "VGA+"; 477 474 request_resource(&ioport_resource, ··· 509 494 } 510 495 } else { 511 496 static struct resource cga_console_resource = 512 - { .name = "cga", .start = 0x3D4, .end = 0x3D5 }; 497 + { .name = "cga", 498 + .flags = IORESOURCE_IO, 499 + .start = 0x3D4, 500 + .end = 0x3D5 }; 513 501 vga_video_type = VIDEO_TYPE_CGA; 514 502 vga_vram_size = 0x2000; 515 503 display_desc = "*CGA";