Skip to content

Commit

Permalink
context: Drop old function _iio_context_add_device()
Browse files Browse the repository at this point in the history
This function is not used anywhere anymore.

Signed-off-by: Paul Cercueil <[email protected]>
  • Loading branch information
pcercuei committed Jan 31, 2024
1 parent 21067e6 commit e1c3a9d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
18 changes: 0 additions & 18 deletions context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions iio-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e1c3a9d

Please sign in to comment.