public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] IDE: bail out of dev_print() for unknown device types
Date: Fri, 15 May 2009 09:27:58 +0200	[thread overview]
Message-ID: <1242372478-8446-1-git-send-email-wd@denx.de> (raw)
In-Reply-To: <200905150727.09965.sr@denx.de>

Commit 574b319512 introduced a subtle bug by mixing a list of tests
for "dev_desc->type" and "dev_desc->if_type" into one switch(), which
then mostly did not work because "dev_desc->type" cannot take any
"IF_*" type values. A later fix in commit 8ec6e332ea changed the
switch() into testing "dev_desc->if_type", but at this point the
initial test for unknown device types was completely lost, which
resulted in output like that for IDE ports without device attached:

  Device 1: Model:  Firm:  Ser#:
            Type: # 1F #
            Capacity: not available

This patch re-introduces the missing test for unknown device types.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
---
v2: fix typo
v3: fix white space

 disk/part.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/disk/part.c b/disk/part.c
index c777493..b92fb45 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -114,6 +114,11 @@ void dev_print (block_dev_desc_t *dev_desc)
 	lbaint_t lba512;
 #endif
 
+	if (dev_desc->type == DEV_TYPE_UNKNOWN) {
+		puts ("not available\n");
+		return;
+	}
+
 	switch (dev_desc->if_type) {
 	case IF_TYPE_SCSI:
 		printf ("(%d:%d) Vendor: %s Prod.: %s Rev: %s\n",
-- 
1.6.0.6

  parent reply	other threads:[~2009-05-15  7:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14  5:24 [U-Boot] [PATCH] cmd_ide: Fix detection problem with missing devices Stefan Roese
2009-05-14 13:44 ` Wolfgang Denk
2009-05-14 13:55   ` Stefan Roese
2009-05-14 14:59     ` Wolfgang Denk
2009-05-14 15:14       ` Stefan Roese
2009-05-14 20:54         ` Wolfgang Denk
2009-05-14 20:57           ` [U-Boot] [PATCH] IDE: bail out of dev_print() for unknow device types Wolfgang Denk
2009-05-14 20:59             ` [U-Boot] [PATCH v2] IDE: bail out of dev_print() for unknown " Wolfgang Denk
2009-05-15  5:27               ` Stefan Roese
2009-05-15  7:27                 ` Wolfgang Denk
2009-05-15  7:33                   ` Stefan Roese
2009-05-15  7:27                 ` Wolfgang Denk [this message]
2009-05-15 20:30                   ` [U-Boot] [PATCH v3] " Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1242372478-8446-1-git-send-email-wd@denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox