Skip to content
Snippets Groups Projects
Commit af75a45d authored by Wolfgang Denk's avatar Wolfgang Denk
Browse files

IDE: bail out of dev_print() for unknown device types


Commit 574b3195 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 8ec6e332 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: default avatarWolfgang Denk <wd@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Tested-by: default avatarStefan Roese <sr@denx.de>
parent c21f62d8
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,11 @@ void dev_print (block_dev_desc_t *dev_desc) ...@@ -114,6 +114,11 @@ void dev_print (block_dev_desc_t *dev_desc)
lbaint_t lba512; lbaint_t lba512;
#endif #endif
if (dev_desc->type == DEV_TYPE_UNKNOWN) {
puts ("not available\n");
return;
}
switch (dev_desc->if_type) { switch (dev_desc->if_type) {
case IF_TYPE_SCSI: case IF_TYPE_SCSI:
printf ("(%d:%d) Vendor: %s Prod.: %s Rev: %s\n", printf ("(%d:%d) Vendor: %s Prod.: %s Rev: %s\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment