base-modem: separate method to lookup exact port by name

There's no point in returning a list of all ports with a given name,
just provide a lookup method that returns the single port with the
given name.
This commit is contained in:
Aleksander Morgado
2021-02-25 14:13:03 +01:00
parent b8e076f9c4
commit 381e2f382b
6 changed files with 53 additions and 31 deletions
@@ -81,8 +81,7 @@ peek_port_qmi_for_data (MMBroadbandModemQmi *self,
/* Find one QMI port, we don't care which one */
rpmsg_qmi_ports = mm_base_modem_find_ports (MM_BASE_MODEM (self),
MM_PORT_SUBSYS_RPMSG,
MM_PORT_TYPE_QMI,
NULL);
MM_PORT_TYPE_QMI);
if (!rpmsg_qmi_ports) {
g_set_error (error,
MM_CORE_ERROR,