staging: dgap: Simplify to set a module type

It is same manner with setting a board type.
After allocating a type of "MNODE", get a token value
set to "module.type".

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Daeseok Youn 2014-08-09 14:39:05 +09:00 коммит произвёл Greg Kroah-Hartman
Родитель f6aa0164cd
Коммит 3cfa648b12
2 изменённых файлов: 7 добавлений и 20 удалений

Просмотреть файл

@ -6388,6 +6388,7 @@ static int dgap_parsefile(char **in)
for (; ;) { for (; ;) {
int board_type = 0; int board_type = 0;
int conc_type = 0; int conc_type = 0;
int module_type = 0;
rc = dgap_gettok(in); rc = dgap_gettok(in);
if (rc == 0) { if (rc == 0) {
@ -6762,24 +6763,15 @@ static int dgap_parsefile(char **in)
else else
brd->u.board.module1++; brd->u.board.module1++;
break; module_type = dgap_gettok(in);
if (module_type == 0 || module_type != PORTS ||
case PORTS: /* ports type EBI module */ module_type != MODEM) {
if (p->type != MNODE) { dgap_err("failed to set a type of module");
dgap_err("ports only valid for EBI modules");
return -1; return -1;
} }
p->u.module.type = PORTS;
p->u.module.v_type = 1;
break;
case MODEM: /* ports type EBI module */ p->u.module.type = module_type;
if (p->type != MNODE) {
dgap_err("modem only valid for modem modules");
return -1;
}
p->u.module.type = MODEM;
p->u.module.v_type = 1;
break; break;
case CABLE: case CABLE:
@ -7207,10 +7199,6 @@ static int dgap_checknode(struct cnode *p)
return 0; return 0;
case MNODE: case MNODE:
if (p->u.module.v_type == 0) {
dgap_err("EBI module type not specified");
return 1;
}
if (p->u.module.v_nport == 0) { if (p->u.module.v_nport == 0) {
dgap_err("number of ports on EBI module not specified"); dgap_err("number of ports on EBI module not specified");
return 1; return 1;

Просмотреть файл

@ -1219,7 +1219,6 @@ struct cnode {
char *id; char *id;
char *idstr; char *idstr;
long start; long start;
char v_type;
char v_nport; char v_nport;
char v_id; char v_id;
char v_start; char v_start;