On 2/10/2021 11:00 AM, ramesh.thomas(a)intel.com wrote:
From: Ramesh Thomas <ramesh.thomas(a)intel.com>
Check for presence of DSA sysfs folder /sys/bus/dsa before running
commands. If not found print an error message and return -ENOENT
Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
---
accfg/accel-config.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/accfg/accel-config.c b/accfg/accel-config.c
index f963fc7..01a1cd9 100644
--- a/accfg/accel-config.c
+++ b/accfg/accel-config.c
@@ -95,6 +95,12 @@ int main(int argc, const char **argv)
return 0;
}
+ if (access("/sys/bus/dsa", R_OK)) {
For the most part this is fine. I
wonder if there will ever be a
platform with IAX and no DSA. Maybe check for dsa || iax?
> + fprintf(stderr,
> + "DSA environment not found. Is the driver loaded?\n");
> + return -ENOENT;
> + }
> +
> rc = accfg_new(&ctx);
> if (rc)
> return 0;