staging: dgap: Simplify to set a concentrator type

It is same manner with setting a board type.
For example of config file for concentrator,
    "conc ccon" or
    "conc epcon"

After allocating a type of "CNODE" then set a type of concentrator.
So remove cases in swith statement, just get a token from string
and set to "conc.type". And also it doesn't need to "conc.v_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:38:41 +09:00 committed by Greg Kroah-Hartman
parent 77a4492fcc
commit f6aa0164cd
2 changed files with 7 additions and 20 deletions

View File

@ -6387,6 +6387,7 @@ static int dgap_parsefile(char **in)
for (; ;) { for (; ;) {
int board_type = 0; int board_type = 0;
int conc_type = 0;
rc = dgap_gettok(in); rc = dgap_gettok(in);
if (rc == 0) { if (rc == 0) {
@ -6719,24 +6720,15 @@ static int dgap_parsefile(char **in)
else else
brd->u.board.conc1++; brd->u.board.conc1++;
break; conc_type = dgap_gettok(in);
if (conc_type == 0 || conc_type != CX ||
case CX: /* c/x type concentrator */ conc_type != EPC) {
if (p->type != CNODE) { dgap_err("failed to set a type of concentratros");
dgap_err("cx only valid for concentrators");
return -1; return -1;
} }
p->u.conc.type = CX;
p->u.conc.v_type = 1;
break;
case EPC: /* epc type concentrator */ p->u.conc.type = conc_type;
if (p->type != CNODE) {
dgap_err("cx only valid for concentrators");
return -1;
}
p->u.conc.type = EPC;
p->u.conc.v_type = 1;
break; break;
case MOD: /* EBI module */ case MOD: /* EBI module */
@ -7200,10 +7192,6 @@ static int dgap_checknode(struct cnode *p)
return 0; return 0;
case CNODE: case CNODE:
if (p->u.conc.v_type == 0) {
dgap_err("concentrator type not specified");
return 1;
}
if (p->u.conc.v_speed == 0) { if (p->u.conc.v_speed == 0) {
dgap_err("concentrator line speed not specified"); dgap_err("concentrator line speed not specified");
return 1; return 1;

View File

@ -1206,7 +1206,6 @@ struct cnode {
char *id; char *id;
char *idstr; char *idstr;
long start; long start;
char v_type;
char v_connect; char v_connect;
char v_speed; char v_speed;
char v_nport; char v_nport;