From 344cc0fc2ce9abf04a4c4d77a8358958129d0a23 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Tue, 30 Jan 2024 17:59:22 +0100 Subject: [PATCH] context: Drop old function _iio_context_add_device() This function is not used anywhere anymore. Signed-off-by: Paul Cercueil --- context.c | 18 ------------------ iio-private.h | 2 -- 2 files changed, 20 deletions(-) diff --git a/context.c b/context.c index 86116c7f0..a202e80e9 100644 --- a/context.c +++ b/context.c @@ -582,24 +582,6 @@ struct iio_device * iio_context_add_device(struct iio_context *ctx, return NULL; } -int _iio_context_add_device(struct iio_context *ctx, struct iio_device *dev) -{ - struct iio_device **devices = realloc(ctx->devices, - (ctx->nb_devices + 1) * sizeof(struct iio_device *)); - - if (!devices) { - ctx_err(ctx, "Unable to allocate memory\n"); - return -ENOMEM; - } - - devices[ctx->nb_devices++] = dev; - ctx->devices = devices; - - ctx_dbg(ctx, "Added device \'%s\' to context \'%s\'\n", - dev->id, ctx->name); - return 0; -} - struct iio_context * iio_create_context_from_xml(const struct iio_context_params *params, const char *uri, const struct iio_backend *backend, diff --git a/iio-private.h b/iio-private.h index 282d88fbb..669cbe72d 100644 --- a/iio-private.h +++ b/iio-private.h @@ -225,8 +225,6 @@ char *iio_strtok_r(char *str, const char *delim, char **saveptr); char * iio_getenv (char * envvar); uint64_t iio_read_counter_us(void); -int _iio_context_add_device(struct iio_context *ctx, struct iio_device *dev); - __cnst const struct iio_context_params *get_default_params(void); extern const struct iio_backend iio_ip_backend;