summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-06-21 15:53:38 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2023-06-27 15:26:29 +0300
commita980cac8368b040d00f59f629b94624f8c559d54 (patch)
treed6d4a9242539baa4080333b351af0317c88f21d6 /drivers/gpu/drm/ast
parent1da14d57526874cefcda494c0d550eeee4f5104e (diff)
downloadlinux-a980cac8368b040d00f59f629b94624f8c559d54.tar.xz
drm/ast: Remove dead else branch in POST code
According to the chip detection in ast_detect_chip(), AST2300 and later always have a PCI revision of 0x20 or higher. Therefore the code in ast_set_def_ext_reg() can not use the else branch when selecing the EXT register values. Remove the dead branch and the related values. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Tested-by: Jocelyn Falempe <jfalempe@redhat.com> # AST2600 Link: https://patchwork.freedesktop.org/patch/msgid/20230621130032.3568-5-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast')
-rw-r--r--drivers/gpu/drm/ast/ast_post.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c
index 0262aaafdb1c..aa3f2cb00f82 100644
--- a/drivers/gpu/drm/ast/ast_post.c
+++ b/drivers/gpu/drm/ast/ast_post.c
@@ -64,14 +64,12 @@ bool ast_is_vga_enabled(struct drm_device *dev)
}
static const u8 extreginfo[] = { 0x0f, 0x04, 0x1c, 0xff };
-static const u8 extreginfo_ast2300a0[] = { 0x0f, 0x04, 0x1c, 0xff };
static const u8 extreginfo_ast2300[] = { 0x0f, 0x04, 0x1f, 0xff };
static void
ast_set_def_ext_reg(struct drm_device *dev)
{
struct ast_device *ast = to_ast_device(dev);
- struct pci_dev *pdev = to_pci_dev(dev->dev);
u8 i, index, reg;
const u8 *ext_reg_info;
@@ -79,13 +77,9 @@ ast_set_def_ext_reg(struct drm_device *dev)
for (i = 0x81; i <= 0x9f; i++)
ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, 0x00);
- if (ast->chip == AST2300 || ast->chip == AST2400 ||
- ast->chip == AST2500) {
- if (pdev->revision >= 0x20)
- ext_reg_info = extreginfo_ast2300;
- else
- ext_reg_info = extreginfo_ast2300a0;
- } else
+ if (ast->chip == AST2300 || ast->chip == AST2400 || ast->chip == AST2500)
+ ext_reg_info = extreginfo_ast2300;
+ else
ext_reg_info = extreginfo;
index = 0xa0;