From 5648215ec317c28e0a7d79fbdd3e56264a95a96c Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Wed, 14 Oct 2020 16:56:58 +0300 Subject: [PATCH] local: make use of the iio_context_pdata() helper 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 --- local.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/local.c b/local.c index f4b3fd457..71baf0437 100644 --- a/local.c +++ b/local.c @@ -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; @@ -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; }