From 43dad07cd45dba129487a8dc55de9f4f850ae7d7 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
Date: Thu, 7 Oct 2021 14:51:01 +0200
Subject: [PATCH] pci: Fix showing registers
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Header type is 7-bit number so use all 7 bits when detecting header type
and not only 2 bits.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
---
 cmd/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/pci.c b/cmd/pci.c
index 4a82854db7..3b1863f139 100644
--- a/cmd/pci.c
+++ b/cmd/pci.c
@@ -239,7 +239,7 @@ static void pci_header_show(struct udevice *dev)
 	       pci_class_str(class));
 	pci_show_regs(dev, regs_rest);
 
-	switch (header_type & 0x03) {
+	switch (header_type & 0x7f) {
 	case PCI_HEADER_TYPE_NORMAL:	/* "normal" PCI device */
 		pci_show_regs(dev, regs_normal);
 		break;
-- 
2.39.5