aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-06-13 20:19:46 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-09-08 00:47:57 +0200
commitc813de0737d1ab67ebd893f2e2205c63ff8a4cdf (patch)
tree06e05f679d15e1bf148e324f044d080000516774
parented334a331f2b429517b8ef77f6312a4630f24e84 (diff)
downloadhardware_replicant_libsamsung-ipc-patches-todo/ipc_device_detect-logging.tar.gz
hardware_replicant_libsamsung-ipc-patches-todo/ipc_device_detect-logging.tar.bz2
hardware_replicant_libsamsung-ipc-patches-todo/ipc_device_detect-logging.zip
It's up to the user of libsamsung-ipc to (1) setup the client structure (2) setup the log backends => We can't fix it unless we setup the log backend first but that require a structure... Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rw-r--r--samsung-ipc/ipc.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c
index 4d9594d..e6fdc62 100644
--- a/samsung-ipc/ipc.c
+++ b/samsung-ipc/ipc.c
@@ -56,25 +56,25 @@ int ipc_device_detect(struct ipc_client *client)
#ifdef IPC_DEVICE_NAME
name = strdup(IPC_DEVICE_NAME);
- ipc_client_log(client,
- "%s: Using driver \"%s\" from IPC_DEVICE_NAME",
+ printf(
+ "%s: Using driver \"%s\" from IPC_DEVICE_NAME\n",
__func__, name);
-#else
- ipc_client_log(client,
- "%s: Detecting driver name from device",
+#else /* IPC_DEVICE_NAME */
+ printf(
+ "%s: Detecting driver name from device\n",
__func__);
-#endif
+#endif /* IPC_DEVICE_NAME */
#ifdef IPC_DEVICE_BOARD_NAME
board_name = strdup(IPC_DEVICE_BOARD_NAME);
- ipc_client_log(client,
- "%s: Using board name \"%s\" from IPC_DEVICE_BOARD_NAME",
- __func__, board_name);
-#else
- ipc_client_log(client,
- "%s: Detecting board name from device",
- __func__);
-#endif
+ printf(
+ "%s: Using board name \"%s\" from IPC_DEVICE_BOARD_NAME\n",
+ __func__, board_name);
+#else /* IPC_DEVICE_BOARD_NAME */
+ printf(
+ "%s: Detecting board name from device\n",
+ __func__);
+
/* Read board name from cpuinfo */
fd = open("/proc/cpuinfo", O_RDONLY);
@@ -109,17 +109,17 @@ int ipc_device_detect(struct ipc_client *client)
line = strtok(NULL, "\n");
}
-#endif
+#endif /* IPC_DEVICE_BOARD_NAME */
-#ifdef IPC_DEVICE_KERNEL_VERSION
+#if IPC_DEVICE_KERNEL_VERSION
kernel_version = strdup(IPC_DEVICE_KERNEL_VERSION);
-#else
+#else /* IPC_DEVICE_KERNEL_VERSION */
memset(&utsname, 0, sizeof(utsname));
uname(&utsname);
kernel_version = strdup(utsname.release);
-#endif
+#endif /* IPC_DEVICE_KERNEL_VERSION */
if (name == NULL && board_name == NULL)
goto error;
@@ -212,7 +212,9 @@ static struct ipc_client *ipc_transport_client_create(int type)
return NULL;
/* Create an early dummy client just for log ouputs */
- client = ipc_dummy_client_create()
+ client = ipc_dummy_client_create();
+
+ ipc_client_log(client, "%s", __func__);
rc = ipc_device_detect(client);
if (rc < 0)