aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-07-03 16:23:00 +0200
committerPaul Kocialkowski <contact@paulk.fr>2013-07-03 16:23:00 +0200
commit25d384a97f6ffa1b31c5248d1f25df74c686b891 (patch)
treeb6a4d31261f9958005610ee06c7cb1c0f164fdb3 /samsung-ipc
parent91c54acd75f6c623eebe18d3cd45387907273eda (diff)
downloadexternal_libsamsung-ipc-25d384a97f6ffa1b31c5248d1f25df74c686b891.zip
external_libsamsung-ipc-25d384a97f6ffa1b31c5248d1f25df74c686b891.tar.gz
external_libsamsung-ipc-25d384a97f6ffa1b31c5248d1f25df74c686b891.tar.bz2
Remove file read functions from ipc_util
Change-Id: I24fcb86335ce2676fa5d88e6298aa002b7257bfe Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'samsung-ipc')
-rw-r--r--samsung-ipc/ipc_util.c92
-rw-r--r--samsung-ipc/util.c1
2 files changed, 0 insertions, 93 deletions
diff --git a/samsung-ipc/ipc_util.c b/samsung-ipc/ipc_util.c
index 6ec54f2..f8b7fe9 100644
--- a/samsung-ipc/ipc_util.c
+++ b/samsung-ipc/ipc_util.c
@@ -29,7 +29,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <asm/types.h>
-#include <mtd/mtd-abi.h>
#include <samsung-ipc.h>
#include "ipc.h"
@@ -473,95 +472,4 @@ void ipc_message_info_fill(struct ipc_header *header, struct ipc_message_info *m
message->data = NULL;
}
-void *ipc_client_mtd_read(struct ipc_client *client, char *mtd_name, int size,
- int block_size)
-{
- void *mtd_p=NULL;
- uint8_t *data_p=NULL;
-
- loff_t offs;
- int fd;
- int i;
-
- if (mtd_name == NULL || size <= 0 || block_size <= 0)
- goto error;
-
- ipc_client_log(client, "ipc_client_mtd_read: reading 0x%x bytes from %s with 0x%x bytes block size\n", size, mtd_name, block_size);
-
- fd=open(mtd_name, O_RDONLY);
- if (fd < 0)
- goto error;
-
- mtd_p=malloc(size);
- if (mtd_p == NULL)
- goto error;
-
- memset(mtd_p, 0, size);
-
- data_p=(uint8_t *) mtd_p;
-
- for (i=0; i < size / block_size; i++)
- {
- offs = i * block_size;
- if (ioctl(fd, MEMGETBADBLOCK, &offs) == 1)
- {
- ipc_client_log(client, "ipc_client_mtd_read: warning: bad block at offset %lld\n", (long long int) offs);
- data_p+=block_size;
- continue;
- }
-
- read(fd, data_p, block_size);
- data_p+=block_size;
- }
-
- close(fd);
-
- return mtd_p;
-
-error:
- ipc_client_log(client, "ipc_client_mtd_read: something went wrong\n");
- return NULL;
-}
-
-void *ipc_client_file_read(struct ipc_client *client, char *file_name, int size,
- int block_size)
-{
- void *file_p=NULL;
- uint8_t *data_p=NULL;
-
- int fd;
- int i;
-
- if (file_name == NULL || size <= 0 || block_size <= 0)
- goto error;
-
- ipc_client_log(client, "ipc_client_file_read: reading 0x%x bytes from %s with 0x%x bytes block size\n", size, file_name, block_size);
-
- fd=open(file_name, O_RDONLY);
- if (fd < 0)
- goto error;
-
- file_p=malloc(size);
- if (file_p == NULL)
- goto error;
-
- memset(file_p, 0, size);
-
- data_p=(uint8_t *) file_p;
-
- for (i=0; i < size / block_size; i++)
- {
- read(fd, data_p, block_size);
- data_p+=block_size;
- }
-
- close(fd);
-
- return file_p;
-
-error:
- ipc_client_log(client, "ipc_client_file_read: something went wrong\n");
- return NULL;
-}
-
// vim:ts=4:sw=4:expandtab
diff --git a/samsung-ipc/util.c b/samsung-ipc/util.c
index 85fffcb..e7bfb01 100644
--- a/samsung-ipc/util.c
+++ b/samsung-ipc/util.c
@@ -29,7 +29,6 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <asm/types.h>
-#include <mtd/mtd-abi.h>
#include <linux/netlink.h>
#include <net/if.h>