338 |
snd_assert(port && info, return -EINVAL); |
snd_assert(port && info, return -EINVAL); |
339 |
|
|
340 |
/* set port name */ |
/* set port name */ |
341 |
if (info->name[0]) { |
if (info->name[0]) |
342 |
strncpy(port->name, info->name, sizeof(port->name)-1); |
strlcpy(port->name, info->name, sizeof(port->name)); |
|
port->name[sizeof(port->name)-1] = '\0'; |
|
|
} |
|
343 |
|
|
344 |
/* set capabilities */ |
/* set capabilities */ |
345 |
port->capability = info->capability; |
port->capability = info->capability; |
361 |
snd_assert(port && info, return -EINVAL); |
snd_assert(port && info, return -EINVAL); |
362 |
|
|
363 |
/* get port name */ |
/* get port name */ |
364 |
strncpy(info->name, port->name, sizeof(info->name)); |
strlcpy(info->name, port->name, sizeof(info->name)); |
365 |
|
|
366 |
/* get capabilities */ |
/* get capabilities */ |
367 |
info->capability = port->capability; |
info->capability = port->capability; |
619 |
/* Set up the port */ |
/* Set up the port */ |
620 |
memset(&portinfo, 0, sizeof(portinfo)); |
memset(&portinfo, 0, sizeof(portinfo)); |
621 |
portinfo.addr.client = client; |
portinfo.addr.client = client; |
622 |
if (portname) |
strlcpy(portinfo.name, portname ? portname : "Unamed port", |
623 |
strncpy(portinfo.name, portname, sizeof(portinfo.name)); |
sizeof(portinfo.name)); |
|
else |
|
|
sprintf(portinfo.name, "Unamed port"); |
|
624 |
|
|
625 |
portinfo.capability = cap; |
portinfo.capability = cap; |
626 |
portinfo.type = type; |
portinfo.type = type; |