From 415de582dcf6f06dc71c9c48eeed0a01bfefc222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=85strand?= Date: Tue, 19 Apr 2022 15:51:09 +0200 Subject: Adapt remoteproc module for more kernel versions The .da_to_va has different signatures for different kernel versions. Add kernel version checks to pick the correct one. Change-Id: Ie25c496aa646119526867c91f244f9ad195860cd --- remoteproc/ethosu_remoteproc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/remoteproc/ethosu_remoteproc.c b/remoteproc/ethosu_remoteproc.c index 493a618..0418ef4 100644 --- a/remoteproc/ethosu_remoteproc.c +++ b/remoteproc/ethosu_remoteproc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Arm Limited. All rights reserved. + * Copyright (c) 2021-2022 Arm Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -93,15 +93,19 @@ static void ethosu_rproc_kick(struct rproc *rproc, return; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0) static void *ethosu_da_to_va(struct rproc *rproc, u64 da, - int len) + size_t len, + bool *is_iomem) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) +static void *ethosu_da_to_va(struct rproc *rproc, + u64 da, + size_t len) #else static void *ethosu_da_to_va(struct rproc *rproc, u64 da, - size_t len, - bool *is_iomem) + int len) #endif { struct ethosu_rproc *ethosu = (struct ethosu_rproc *)rproc->priv; -- cgit v1.2.1