Skip to contentSkip to conversation

accel-config: Fix char device path issue with iax device type

PATCH In review ramesh.thomas at intel.com 2 participants 2 messages Jun 28, 2021

lore
Share & tools
lore

ramesh.thomas at intel.com

#0 lore raw

PATCH 1/1 accel-config: Fix char device path issue with iax device type

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Even in kernel versions where iax bus type was removed dsa driver creates char device path under iax. Use device type to create the path instead of bus type in accel-config.

Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>
---
 accfg/lib/libaccfg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
accfg/lib/libaccfg.c +3 -3
index 1463a4d..f53751e 100644
@@ -2093,7 +2093,7 @@ ACCFG_EXPORT int accfg_wq_get_user_dev_path(struct accfg_wq *wq, char *buf,
 
 	ctx = accfg_device_get_ctx(wq->device);
 
-	sprintf(p, "/dev/%s", wq->device->bus_type_str);
+	sprintf(p, "/dev/%s", wq->device->device_type_str);
 	n1 = n = scandir(p, &d, NULL, alphasort);
 	if (n < 0) {
 		err(ctx, "Device path not found %s\n", p);
@@ -2112,12 +2112,12 @@ ACCFG_EXPORT int accfg_wq_get_user_dev_path(struct accfg_wq *wq, char *buf,
 	if (n < 0) {
 		err(ctx, "Device for %s not found at /dev/%s\n",
 				accfg_wq_get_devname(wq),
-				wq->device->bus_type_str);
+				wq->device->device_type_str);
 		rc = -ENOENT;
 		goto ext_uacce;
 	}
 
-	n = sprintf(p, "/dev/%s/%s", wq->device->bus_type_str, f);
+	n = sprintf(p, "/dev/%s/%s", wq->device->device_type_str, f);
 
 	if ((size_t)n >= size) {
 		err(ctx, "Buffer size too small. Need %d bytes\n", n + 1);
Signature · 1 line
2.26.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · ramesh.thomas(a)intel.com

From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Even in kernel versions where iax bus type was removed dsa driver creates char device path under iax. Use device type to create the path instead of bus type in accel-config.

Signed-off-by Ramesh Thomas <ramesh.thomas(a)intel.com>
Reviewed-by Dave Jiang <dave.jiang(a)intel.com>
Quoted 32 lines
---
  accfg/lib/libaccfg.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
accfg/lib/libaccfg.c +3 -3
index 1463a4d..f53751e 100644
@@ -2093,7 +2093,7 @@ ACCFG_EXPORT int accfg_wq_get_user_dev_path(struct accfg_wq *wq, char *buf,
 
  	ctx = accfg_device_get_ctx(wq->device);
 
-	sprintf(p, "/dev/%s", wq->device->bus_type_str);
+	sprintf(p, "/dev/%s", wq->device->device_type_str);
  	n1 = n = scandir(p, &d, NULL, alphasort);
  	if (n < 0) {
  		err(ctx, "Device path not found %s\n", p);
@@ -2112,12 +2112,12 @@ ACCFG_EXPORT int accfg_wq_get_user_dev_path(struct accfg_wq *wq, char *buf,
  	if (n < 0) {
  		err(ctx, "Device for %s not found at /dev/%s\n",
  				accfg_wq_get_devname(wq),
-				wq->device->bus_type_str);
+				wq->device->device_type_str);
  		rc = -ENOENT;
  		goto ext_uacce;
  	}
 
-	n = sprintf(p, "/dev/%s/%s", wq->device->bus_type_str, f);
+	n = sprintf(p, "/dev/%s/%s", wq->device->device_type_str, f);
 
  	if ((size_t)n >= size) {
  		err(ctx, "Buffer size too small. Need %d bytes\n", n + 1);