From 6ede569a63ce4f4ead3865b96c5dfff4e9b2fcaf Mon Sep 17 00:00:00 2001
From: Wenkai Lin <linwenkai6@hisilicon.com>
Date: Tue, 4 Jan 2022 16:48:01 +0800
Subject: [PATCH 35/53] uadk: fix wd_request_ctx

wd_get_accel_name and strncpy should use relative path.

Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
---
 wd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/wd.c b/wd.c
index 238ce8a..746fa02 100644
--- a/wd.c
+++ b/wd.c
@@ -328,11 +328,11 @@ handle_t wd_request_ctx(struct uacce_dev *dev)
 	if (!ctx)
 		return 0;
 
-	ctx->dev_name = wd_get_accel_name(char_dev_path, 0);
+	ctx->dev_name = wd_get_accel_name(dev->char_dev_path, 0);
 	if (!ctx->dev_name)
 		goto free_ctx;
 
-	ctx->drv_name = wd_get_accel_name(char_dev_path, 1);
+	ctx->drv_name = wd_get_accel_name(dev->char_dev_path, 1);
 	if (!ctx->drv_name)
 		goto free_dev_name;
 
@@ -342,7 +342,7 @@ handle_t wd_request_ctx(struct uacce_dev *dev)
 
 	wd_ctx_init_qfrs_offs(ctx);
 
-	strncpy(ctx->dev_path, char_dev_path, MAX_DEV_NAME_LEN);
+	strncpy(ctx->dev_path, dev->char_dev_path, MAX_DEV_NAME_LEN);
 	ctx->dev_path[MAX_DEV_NAME_LEN - 1] = '\0';
 
 	ctx->fd = open(char_dev_path, O_RDWR | O_CLOEXEC);
-- 
2.25.1

