Skip to content

Commit

Permalink
iio-backend: Remove unused callback .get_description
Browse files Browse the repository at this point in the history
This callback was introduced in commit d61f629 ("iio: backend: add
get_description() backend op") but was never called anywhere, as the
backend's description string is also present in the XML directly.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Feb 16, 2022
1 parent 0ed18cd commit e9c8011
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
2 changes: 0 additions & 2 deletions iio-backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ struct iio_backend_ops {

void (*shutdown)(struct iio_context *ctx);

char * (*get_description)(const struct iio_context *ctx);

int (*get_version)(const struct iio_context *ctx, unsigned int *major,
unsigned int *minor, char git_tag[8]);

Expand Down
1 change: 0 additions & 1 deletion local.c
Original file line number Diff line number Diff line change
Expand Up @@ -1976,7 +1976,6 @@ static const struct iio_backend_ops local_ops = {
.get_trigger = local_get_trigger,
.set_trigger = local_set_trigger,
.shutdown = local_shutdown,
.get_description = local_get_description,
.set_timeout = local_set_timeout,
.cancel = local_cancel,
};
Expand Down
12 changes: 2 additions & 10 deletions network.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int create_socket(const struct addrinfo *addrinfo)
return fd;
}

static char * __network_get_description(struct addrinfo *res)
static char * network_get_description(struct addrinfo *res)
{
char *description;
unsigned int len;
Expand Down Expand Up @@ -334,13 +334,6 @@ static char * __network_get_description(struct addrinfo *res)
return description;
}

static char *network_get_description(const struct iio_context *ctx)
{
struct iio_context_pdata *pdata = iio_context_get_pdata(ctx);

return __network_get_description(pdata->addrinfo);
}

static int network_open(const struct iio_device *dev,
size_t samples_count, bool cyclic)
{
Expand Down Expand Up @@ -926,7 +919,6 @@ static const struct iio_backend_ops network_ops = {
.get_trigger = network_get_trigger,
.set_trigger = network_set_trigger,
.shutdown = network_shutdown,
.get_description = network_get_description,
.get_version = network_get_version,
.set_timeout = network_set_timeout,
.set_kernel_buffers_count = network_set_kernel_buffers_count,
Expand Down Expand Up @@ -1144,7 +1136,7 @@ struct iio_context * network_create_context(const char *host)
goto err_close_socket;
}

description = __network_get_description(res);
description = network_get_description(res);
if (!description)
goto err_free_pdata;

Expand Down
12 changes: 2 additions & 10 deletions serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static int serial_get_version(const struct iio_context *ctx,
major, minor, git_tag);
}

static char * __serial_get_description(struct sp_port *port)
static char * serial_get_description(struct sp_port *port)
{
char *description, *name, *desc;
size_t desc_len;
Expand All @@ -125,13 +125,6 @@ static char * __serial_get_description(struct sp_port *port)
return description;
}

static char * serial_get_description(const struct iio_context *ctx)
{
struct iio_context_pdata *pdata = iio_context_get_pdata(ctx);

return __serial_get_description(pdata->port);
}

static int serial_open(const struct iio_device *dev,
size_t samples_count, bool cyclic)
{
Expand Down Expand Up @@ -385,7 +378,6 @@ static const struct iio_backend_ops serial_ops = {
.write_channel_attr = serial_write_chn_attr,
.set_kernel_buffers_count = serial_set_kernel_buffers_count,
.shutdown = serial_shutdown,
.get_description = serial_get_description,
.set_timeout = serial_set_timeout,
.get_trigger = serial_get_trigger,
.set_trigger = serial_set_trigger,
Expand Down Expand Up @@ -463,7 +455,7 @@ static struct iio_context * serial_create_context(const char *port_name,
/* Empty the buffers */
sp_flush(port, SP_BUF_BOTH);

description = __serial_get_description(port);
description = serial_get_description(port);
if (!description)
goto err_close_port;

Expand Down

0 comments on commit e9c8011

Please sign in to comment.