diff options
-rw-r--r-- | xivovp/base.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/xivovp/base.c b/xivovp/base.c index 7095e21..fedd38d 100644 --- a/xivovp/base.c +++ b/xivovp/base.c @@ -110,23 +110,10 @@ static void xivovp_receive_and_transmit(void *data) } #endif -/* Shouldn't there be something better there? TOTHINK */ +/* Returns the xivovp_line which line is the same as the VpLineCtxType */ static struct xivovp_line* xivovp_line_from_ctx(VpLineCtxType* line_ctx) { - Vp890LineObjectType* line_obj; - int i; - - if (!line_ctx) - panic(DRV_NAME ": LineCtx == NULL\n"); - - line_obj = line_ctx->pLineObj; - - for (i = 0; i < NB_LINES; i++) - if (&xivovp.line[i].line_obj == line_obj) - return &xivovp.line[i]; - - panic(DRV_NAME ": unknown FX line, this shouldn't happen\n"); - return NULL; + return container_of(line_ctx->pLineObj, struct xivovp_line, line_obj); } static void vp_set_debug_select_running(void) |