]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: bochs: Drop the useless argument of bochs_vga_write()
authorBin Meng <bmeng@tinylab.org>
Sun, 23 Jul 2023 04:40:26 +0000 (12:40 +0800)
committerAnatolij Gustschin <agust@denx.de>
Tue, 1 Aug 2023 11:30:41 +0000 (13:30 +0200)
bochs_vga_write() takes 'index' as one argument, but never uses it.

While we are here, use macros instead of magic numbers for the
VGA IO port register name and value.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # qemu-x86_64
drivers/video/bochs.c
drivers/video/bochs.h

index fa0283c158a59f580aed863ef7e6dfbb9fb7711c..2d4526c71432fb82a64f62010189be5c26d0beb5 100644 (file)
@@ -27,9 +27,9 @@ static int bochs_read(void *mmio, int index)
        return readw(mmio + MMIO_BASE + index * 2);
 }
 
-static void bochs_vga_write(int index, uint8_t val)
+static void bochs_vga_write(uint8_t val)
 {
-       outb(val, VGA_INDEX);
+       outb(val, VGA_ATT_W);
 }
 
 static int bochs_init_fb(struct udevice *dev)
@@ -78,7 +78,8 @@ static int bochs_init_fb(struct udevice *dev)
        bochs_write(mmio, INDEX_Y_OFFSET, 0);
        bochs_write(mmio, INDEX_ENABLE, ENABLED | LFB_ENABLED);
 
-       bochs_vga_write(0, 0x20);       /* disable blanking */
+       /* disable blanking */
+       bochs_vga_write(VGA_AR_ENABLE_DISPLAY);
 
        plat->base = fb;
 
index 4c8ec83a550eabfccdb63870444d9cc0c6ad55e4..71d3d60141e781befadf5f8e89b1094551ce9fbf 100644 (file)
@@ -6,7 +6,10 @@
 #ifndef __BOCHS_H
 #define __BOCHS_H
 
-#define VGA_INDEX      0x3c0
+#define VGA_INDEX              0x3c0
+
+#define VGA_ATT_W              0x3c0
+#define VGA_AR_ENABLE_DISPLAY  0x20
 
 #define IOPORT_INDEX   0x01ce
 #define IOPORT_DATA    0x01cf