Skip to content

Commit

Permalink
local: make use of the iio_context_pdata() helper
Browse files Browse the repository at this point in the history
The local backend does a minimal use of it's backend. Mostly some timeout
handling. This change replaces the access of the context's pdata via
iio_context_pdata().

Signed-off-by: Alexandru Ardelean <[email protected]>
  • Loading branch information
commodo committed Oct 15, 2020
1 parent 38f1ead commit 5648215
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions local.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ static int device_check_ready(const struct iio_device *dev, short events,
.events = POLLIN,
}
};
unsigned int rw_timeout_ms = dev->ctx->pdata->rw_timeout_ms;
struct iio_context_pdata *pdata = iio_context_get_pdata(dev->ctx);
unsigned int rw_timeout_ms = pdata->rw_timeout_ms;
int timeout_rel;
int ret;

Expand Down Expand Up @@ -1900,7 +1901,9 @@ static int add_debug(void *d, const char *path)

static int local_set_timeout(struct iio_context *ctx, unsigned int timeout)
{
ctx->pdata->rw_timeout_ms = timeout;
struct iio_context_pdata *pdata = iio_context_get_pdata(ctx);

pdata->rw_timeout_ms = timeout;
return 0;
}

Expand Down

0 comments on commit 5648215

Please sign in to comment.