/*
* General debugfs helpers
*/
-int igt_debugfs_init(igt_debugfs_t *debugfs)
+void igt_debugfs_init(igt_debugfs_t *debugfs)
{
const char *path = "/sys/kernel/debug";
struct stat st;
if (stat("/sys/kernel/debug/dri", &st) == 0)
goto find_minor;
- if (stat("/sys/kernel/debug", &st))
- return errno;
+ igt_assert(stat("/sys/kernel/debug", &st) == 0);
- if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
- return errno;
+ igt_assert(mount("debug", "/sys/kernel/debug", "debugfs", 0, 0) == 0);
find_minor:
strcpy(debugfs->root, path);
sprintf(debugfs->dri_path + len, "/i915_error_state");
if (stat(debugfs->dri_path, &st) == 0) {
debugfs->dri_path[len] = '\0';
- return 0;
+ return;
}
}
debugfs->dri_path[0] = '\0';
- return ENOENT;
+
+ igt_fail(4);
}
int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename, int mode)
char dri_path[128];
} igt_debugfs_t;
-int igt_debugfs_init(igt_debugfs_t *debugfs);
+void igt_debugfs_init(igt_debugfs_t *debugfs);
int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename, int mode);
FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename,
const char *mode);
"Kernel is too old, or contexts not supported: %s\n",
strerror(errno));
- assert(igt_debugfs_init(&dfs) == 0);
+ igt_debugfs_init(&dfs);
}
igt_subtest("params")