]> git.sur5r.net Git - u-boot/commitdiff
Fix disk type output in disk/part.c
authorDetlev Zundel <dzu@denx.de>
Mon, 5 May 2008 14:11:21 +0000 (16:11 +0200)
committerWolfgang Denk <wd@denx.de>
Fri, 9 May 2008 19:26:34 +0000 (21:26 +0200)
Signed-off-by: Detlev Zundel <dzu@denx.de>
disk/part.c

index 3c71208a12bb0e05cbb9e3e112bc83e114ceaa69..1f8538abbfacd215e2aa55c78dc1d8548d1a05e5 100644 (file)
@@ -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)