Commit 8da8a56c authored by Adam Wujek's avatar Adam Wujek 💬

userspace/wrsw_hal: fix debug printout after port role matching

Print correct role after role matching
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent b1efe61c
......@@ -149,7 +149,8 @@ static int hal_port_init(int index)
{"master", HEXP_PORT_MODE_WR_MASTER},
{"slave", HEXP_PORT_MODE_WR_SLAVE},
{"non-wr", HEXP_PORT_MODE_NON_WR},
{NULL, HEXP_PORT_MODE_NON_WR /* default */},
{NULL, HEXP_PORT_MODE_NON_WR /* default,
* should exist and be last*/},
};
strcpy(s, "non-wr"); /* default if no string passed */
......@@ -164,11 +165,18 @@ static int hal_port_init(int index)
if (!strcasecmp(s, rp->name))
break;
p->mode = rp->value;
if (!rp->name)
if (!rp->name) {
for (rp = rt; rp->name; rp++)
if (p->mode == rp->value)
break;
pr_error("port %i (%s): invalid role "
"\"%s\" specified\n", port_i, name, s);
"\"%s\" specified; using mode %s\n", port_i,
name, s, rp->name);
}
pr_debug("Port %s: mode %i\n", p->name, val);
pr_debug("Port %s: mode %s (%i)\n", p->name, rp->name,
p->mode);
}
/* Get fiber type */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment