Skip to content
Snippets Groups Projects
Commit 5ec4f1a5 authored by Simon Glass's avatar Simon Glass
Browse files

dm: blk: Convert interface type to an enum


Since these are sequentially numbered it makes sense to use an enum. It
avoids having to maintain the maximum value, and provides a type we can use
if it is useful.

In fact the maximum value is not used. Rename it to COUNT, since MAX suggests
it is the maximum valid value, but it is not.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Tested-by: default avatarStephen Warren <swarren@nvidia.com>
parent 1a73661b
No related branches found
No related tags found
No related merge requests found
...@@ -19,20 +19,23 @@ typedef ulong lbaint_t; ...@@ -19,20 +19,23 @@ typedef ulong lbaint_t;
#define LBAFU "%" LBAFlength "u" #define LBAFU "%" LBAFlength "u"
/* Interface types: */ /* Interface types: */
#define IF_TYPE_UNKNOWN 0 enum if_type {
#define IF_TYPE_IDE 1 IF_TYPE_UNKNOWN = 0,
#define IF_TYPE_SCSI 2 IF_TYPE_IDE,
#define IF_TYPE_ATAPI 3 IF_TYPE_SCSI,
#define IF_TYPE_USB 4 IF_TYPE_ATAPI,
#define IF_TYPE_DOC 5 IF_TYPE_USB,
#define IF_TYPE_MMC 6 IF_TYPE_DOC,
#define IF_TYPE_SD 7 IF_TYPE_MMC,
#define IF_TYPE_SATA 8 IF_TYPE_SD,
#define IF_TYPE_HOST 9 IF_TYPE_SATA,
#define IF_TYPE_MAX 10 /* Max number of IF_TYPE_* supported */ IF_TYPE_HOST,
IF_TYPE_COUNT, /* Number of interface types */
};
struct blk_desc { struct blk_desc {
int if_type; /* type of the interface */ enum if_type if_type; /* type of the interface */
int dev; /* device number */ int dev; /* device number */
unsigned char part_type; /* partition type */ unsigned char part_type; /* partition type */
unsigned char target; /* target SCSI ID */ unsigned char target; /* target SCSI ID */
......
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