summaryrefslogtreecommitdiffstats
path: root/disk/part.c
diff options
context:
space:
mode:
authorDetlev Zundel <dzu@denx.de>2008-05-05 16:11:21 +0200
committerWolfgang Denk <wd@denx.de>2008-05-09 21:26:34 +0200
commit574b319512b13e10800f0045e39b993f4ca25e42 (patch)
treea7bde2a666976f8bd5a3b3f8009164f6f1191544 /disk/part.c
parent045b4d2d7168ef09c7349dcf6ecebe7432b74171 (diff)
downloadbootable_bootloader_goldelico_gta04-574b319512b13e10800f0045e39b993f4ca25e42.zip
bootable_bootloader_goldelico_gta04-574b319512b13e10800f0045e39b993f4ca25e42.tar.gz
bootable_bootloader_goldelico_gta04-574b319512b13e10800f0045e39b993f4ca25e42.tar.bz2
Fix disk type output in disk/part.c
Signed-off-by: Detlev Zundel <dzu@denx.de>
Diffstat (limited to 'disk/part.c')
-rw-r--r--disk/part.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/disk/part.c b/disk/part.c
index 3c71208..1f8538a 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -109,29 +109,25 @@ 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;
- }
- if (dev_desc->if_type==IF_TYPE_SCSI) {
- printf ("(%d:%d) ", dev_desc->target,dev_desc->lun);
- }
- if (dev_desc->if_type==IF_TYPE_IDE) {
- printf ("Model: %s Firm: %s Ser#: %s\n",
+ switch (dev_desc->type) {
+ case IF_TYPE_SCSI:
+ printf ("(%d:%d) Vendor: %s Prod.: %s Rev: %s\n",
+ dev_desc->target,dev_desc->lun,
dev_desc->vendor,
- dev_desc->revision,
- dev_desc->product);
- }
- if (dev_desc->if_type==IF_TYPE_SATA) {
+ dev_desc->product,
+ dev_desc->revision);
+ break;
+ case IF_TYPE_IDE:
+ case IF_TYPE_SATA:
printf ("Model: %s Firm: %s Ser#: %s\n",
dev_desc->vendor,
dev_desc->revision,
dev_desc->product);
- } else {
- printf ("Vendor: %s Prod.: %s Rev: %s\n",
- dev_desc->vendor,
- dev_desc->product,
- dev_desc->revision);
+ break;
+ case DEV_TYPE_UNKNOWN:
+ default:
+ puts ("not available\n");
+ return;
}
puts (" Type: ");
if (dev_desc->removable)