aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2012-12-15 19:13:47 +0100
committerPaul Kocialkowski <contact@paulk.fr>2012-12-15 19:13:47 +0100
commitda6bf32cfc0bd4b4cf46422e6653a6a3cb4877a1 (patch)
tree9e1f264bbb9ecbf162a5f437774e01a0bf48dfab /samsung-ipc
parent617169fce836a9b31d6c629a4b16c886b311fb3f (diff)
downloadhardware_replicant_libsamsung-ipc-da6bf32cfc0bd4b4cf46422e6653a6a3cb4877a1.tar.gz
hardware_replicant_libsamsung-ipc-da6bf32cfc0bd4b4cf46422e6653a6a3cb4877a1.tar.bz2
hardware_replicant_libsamsung-ipc-da6bf32cfc0bd4b4cf46422e6653a6a3cb4877a1.zip
Permit explicit board name instead of device name
Change-Id: I7ed51c0a35061daeaac302c8bac90a1c3b577e1d Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
-rw-r--r--samsung-ipc/ipc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c
index b6b6b1b..efba73a 100644
--- a/samsung-ipc/ipc.c
+++ b/samsung-ipc/ipc.c
@@ -64,17 +64,17 @@ void ipc_client_log(struct ipc_client *client, const char *message, ...)
int ipc_device_detect(void)
{
- char *device = NULL;
+ char *board_name = NULL;
char *kernel_version = NULL;
int index = -1;
int i;
-#ifdef IPC_DEVICE_EXPLICIT
- device = strdup(IPC_DEVICE_EXPLICIT);
+#ifdef IPC_BOARD_NAME_EXPLICIT
+ board_name = strdup(IPC_BOARD_NAME_EXPLICIT);
#else
char buf[4096];
- // gather device type from /proc/cpuinfo
+ // gather board name type from /proc/cpuinfo
int fd = open("/proc/cpuinfo", O_RDONLY);
int bytesread = read(fd, buf, 4096);
close(fd);
@@ -96,7 +96,7 @@ int ipc_device_detect(void)
str[i] = tmp;
}
- device = strdup(pch);
+ board_name = strdup(pch);
}
pch = strtok(NULL, "\n");
}
@@ -115,7 +115,7 @@ int ipc_device_detect(void)
for (i=0 ; i < ipc_devices_count ; i++)
{
- if (strstr(device, ipc_devices[i].board_name) != NULL)
+ if (strstr(board_name, ipc_devices[i].board_name) != NULL)
{
if (ipc_devices[i].kernel_version != NULL)
{
@@ -134,8 +134,8 @@ int ipc_device_detect(void)
}
}
- if (device != NULL)
- free(device);
+ if (board_name != NULL)
+ free(board_name);
if (kernel_version != NULL)
free(kernel_version);
@@ -143,7 +143,7 @@ int ipc_device_detect(void)
return index;
}
-struct ipc_client* ipc_client_new(int client_type)
+struct ipc_client *ipc_client_new(int client_type)
{
struct ipc_client *client;
int device_index = -1;
@@ -156,7 +156,7 @@ struct ipc_client* ipc_client_new(int client_type)
if (client_type < 0 || client_type > IPC_CLIENT_TYPE_RFS)
return NULL;
- client = (struct ipc_client*) malloc(sizeof(struct ipc_client));
+ client = (struct ipc_client *) malloc(sizeof(struct ipc_client));
memset(client, 0, sizeof(struct ipc_client));
client->type = client_type;