summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2022-03-09 13:03:10 +0100
committerAleksander Morgado <aleksander@aleksander.es>2022-03-09 13:06:46 +0100
commit26def72b8eea1e23db05ac439f8c0462627443a4 (patch)
tree3c5310b208b7501deec1d9ee571a257167604b13 /src
parent63921c9db3b5fd6e14c3d42b84eaa76835231d91 (diff)
downloadlibqmi-26def72b8eea1e23db05ac439f8c0462627443a4.tar.gz
qmi-firmware-update: qfu_helpers_find_peer_port() isn't udev specific
Diffstat (limited to 'src')
-rw-r--r--src/qmi-firmware-update/qfu-helpers-udev.c16
-rw-r--r--src/qmi-firmware-update/qfu-helpers-udev.h2
-rw-r--r--src/qmi-firmware-update/qfu-helpers.c18
-rw-r--r--src/qmi-firmware-update/qfu-helpers.h8
4 files changed, 25 insertions, 19 deletions
diff --git a/src/qmi-firmware-update/qfu-helpers-udev.c b/src/qmi-firmware-update/qfu-helpers-udev.c
index 516cdd0e..c9b9fa35 100644
--- a/src/qmi-firmware-update/qfu-helpers-udev.c
+++ b/src/qmi-firmware-update/qfu-helpers-udev.c
@@ -214,22 +214,6 @@ qfu_helpers_udev_find_by_file_path (const gchar *path,
return sysfs_path;
}
-gchar *
-qfu_helpers_udev_find_peer_port (const gchar *sysfs_path,
- GError **error)
-{
- gchar *tmp, *path;
-
- tmp = g_build_filename (sysfs_path, "port", "peer", NULL);
- path = realpath (tmp, NULL);
- g_free (tmp);
- if (!path)
- return NULL;
-
- g_debug ("[qfu-udev] peer port for '%s' found: %s", sysfs_path, path);
- return path;
-}
-
/******************************************************************************/
static gboolean
diff --git a/src/qmi-firmware-update/qfu-helpers-udev.h b/src/qmi-firmware-update/qfu-helpers-udev.h
index 7d5a8962..9ee7d0ff 100644
--- a/src/qmi-firmware-update/qfu-helpers-udev.h
+++ b/src/qmi-firmware-update/qfu-helpers-udev.h
@@ -35,8 +35,6 @@ gchar *qfu_helpers_udev_find_by_file (GFile *file,
GError **error);
gchar *qfu_helpers_udev_find_by_file_path (const gchar *path,
GError **error);
-gchar *qfu_helpers_udev_find_peer_port (const gchar *sysfs_path,
- GError **error);
gchar *qfu_helpers_udev_find_by_device_info (guint16 vid,
guint16 pid,
guint busnum,
diff --git a/src/qmi-firmware-update/qfu-helpers.c b/src/qmi-firmware-update/qfu-helpers.c
index 770a8584..36c86811 100644
--- a/src/qmi-firmware-update/qfu-helpers.c
+++ b/src/qmi-firmware-update/qfu-helpers.c
@@ -37,3 +37,21 @@ qfu_helpers_device_type_to_string (QfuHelpersDeviceType type)
{
return device_type_str[type];
}
+
+/******************************************************************************/
+
+gchar *
+qfu_helpers_find_peer_port (const gchar *sysfs_path,
+ GError **error)
+{
+ gchar *tmp, *path;
+
+ tmp = g_build_filename (sysfs_path, "port", "peer", NULL);
+ path = realpath (tmp, NULL);
+ g_free (tmp);
+ if (!path)
+ return NULL;
+
+ g_debug ("[qfu-helpers] peer port for '%s' found: %s", sysfs_path, path);
+ return path;
+}
diff --git a/src/qmi-firmware-update/qfu-helpers.h b/src/qmi-firmware-update/qfu-helpers.h
index 8f1e5031..b3b13642 100644
--- a/src/qmi-firmware-update/qfu-helpers.h
+++ b/src/qmi-firmware-update/qfu-helpers.h
@@ -36,11 +36,17 @@ typedef enum {
const gchar *qfu_helpers_device_type_to_string (QfuHelpersDeviceType type);
+/******************************************************************************/
+
+gchar *qfu_helpers_find_peer_port (const gchar *sysfs_path,
+ GError **error);
+
+/******************************************************************************/
+
#if defined WITH_UDEV
# include "qfu-helpers-udev.h"
# define qfu_helpers_find_by_file qfu_helpers_udev_find_by_file
# define qfu_helpers_find_by_file_path qfu_helpers_udev_find_by_file_path
-# define qfu_helpers_find_peer_port qfu_helpers_udev_find_peer_port
# define qfu_helpers_find_by_device_info qfu_helpers_udev_find_by_device_info
# define qfu_helpers_list_devices qfu_helpers_udev_list_devices
# define qfu_helpers_wait_for_device qfu_helpers_udev_wait_for_device