12
12
#include <blk.h>
13
13
#include <command.h>
14
14
15
- int blk_common_cmd (int argc , char * const argv [], enum uclass_id if_type ,
15
+ int blk_common_cmd (int argc , char * const argv [], enum uclass_id uclass_id ,
16
16
int * cur_devnump )
17
17
{
18
- const char * if_name = blk_get_if_type_name ( if_type );
18
+ const char * if_name = blk_get_uclass_name ( uclass_id );
19
19
20
20
switch (argc ) {
21
21
case 0 :
22
22
case 1 :
23
23
return CMD_RET_USAGE ;
24
24
case 2 :
25
25
if (strncmp (argv [1 ], "inf" , 3 ) == 0 ) {
26
- blk_list_devices (if_type );
26
+ blk_list_devices (uclass_id );
27
27
return 0 ;
28
28
} else if (strncmp (argv [1 ], "dev" , 3 ) == 0 ) {
29
- if (blk_print_device_num (if_type , * cur_devnump )) {
29
+ if (blk_print_device_num (uclass_id , * cur_devnump )) {
30
30
printf ("\nno %s devices available\n" , if_name );
31
31
return CMD_RET_FAILURE ;
32
32
}
33
33
return 0 ;
34
34
} else if (strncmp (argv [1 ], "part" , 4 ) == 0 ) {
35
- if (blk_list_part (if_type ))
35
+ if (blk_list_part (uclass_id ))
36
36
printf ("\nno %s partition table available\n" ,
37
37
if_name );
38
38
return 0 ;
@@ -42,7 +42,7 @@ int blk_common_cmd(int argc, char *const argv[], enum uclass_id if_type,
42
42
if (strncmp (argv [1 ], "dev" , 3 ) == 0 ) {
43
43
int dev = (int )dectoul (argv [2 ], NULL );
44
44
45
- if (!blk_show_device (if_type , dev )) {
45
+ if (!blk_show_device (uclass_id , dev )) {
46
46
* cur_devnump = dev ;
47
47
printf ("... is now current device\n" );
48
48
} else {
@@ -52,7 +52,7 @@ int blk_common_cmd(int argc, char *const argv[], enum uclass_id if_type,
52
52
} else if (strncmp (argv [1 ], "part" , 4 ) == 0 ) {
53
53
int dev = (int )dectoul (argv [2 ], NULL );
54
54
55
- if (blk_print_part_devnum (if_type , dev )) {
55
+ if (blk_print_part_devnum (uclass_id , dev )) {
56
56
printf ("\n%s device %d not available\n" ,
57
57
if_name , dev );
58
58
return CMD_RET_FAILURE ;
@@ -71,7 +71,7 @@ int blk_common_cmd(int argc, char *const argv[], enum uclass_id if_type,
71
71
printf ("\n%s read: device %d block # " LBAFU ", count %lu ... " ,
72
72
if_name , * cur_devnump , blk , cnt );
73
73
74
- n = blk_read_devnum (if_type , * cur_devnump , blk , cnt ,
74
+ n = blk_read_devnum (uclass_id , * cur_devnump , blk , cnt ,
75
75
(ulong * )addr );
76
76
77
77
printf ("%ld blocks read: %s\n" , n ,
@@ -86,7 +86,7 @@ int blk_common_cmd(int argc, char *const argv[], enum uclass_id if_type,
86
86
printf ("\n%s write: device %d block # " LBAFU ", count %lu ... " ,
87
87
if_name , * cur_devnump , blk , cnt );
88
88
89
- n = blk_write_devnum (if_type , * cur_devnump , blk , cnt ,
89
+ n = blk_write_devnum (uclass_id , * cur_devnump , blk , cnt ,
90
90
(ulong * )addr );
91
91
92
92
printf ("%ld blocks written: %s\n" , n ,
0 commit comments