drm/ast: Fix test for VGA enabled
authorY.C. Chen <yc_chen@aspeedtech.com>
Wed, 22 Feb 2017 04:10:50 +0000 (15:10 +1100)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:17:30 +0000 (13:17 +0000)
commit 905f21a49d388de3e99438235f3301cabf0c0ef4 upstream.

The test to see if VGA was already enabled is doing an unnecessary
second test from a register that may or may not have been initialized
to a valid value. Remove it.

Signed-off-by: Y.C. Chen <yc_chen@aspeedtech.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Joel Stanley <joel@jms.id.au>
Tested-by: Y.C. Chen <yc_chen@aspeedtech.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/gpu/drm/ast/ast_post.c

index 977cfb35837a004b6078fb121125d239464df90a..d3464f35f427b8d040d60f8afc51449b5626e3e5 100644 (file)
@@ -53,13 +53,9 @@ ast_is_vga_enabled(struct drm_device *dev)
                /* TODO 1180 */
        } else {
                ch = ast_io_read8(ast, 0x43);
-               if (ch) {
-                       ast_open_key(ast);
-                       ch = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xff);
-                       return ch & 0x04;
-               }
+               return !!(ch & 0x01);
        }
-       return 0;
+       return false;
 }
 #endif