diff options
author | José Roberto de Souza <jose.souza@intel.com> | 2019-11-13 13:37:49 -0800 |
---|---|---|
committer | José Roberto de Souza <jose.souza@intel.com> | 2019-11-18 10:12:54 -0800 |
commit | d9ac618d1692f24b539be20e41b6af616776af56 (patch) | |
tree | 122fd83cdc780d5152c38a949f72f42b741f4974 /lib/igt_psr.c | |
parent | ea9cd47fdb72c16d5ec84c04a85122c451c30025 (diff) |
lib/igt_psr: Unset errno when expected
Writing 0xf to i915_edp_psr_debug is expected to have -EINVAL
returned in newer kernels but this error actually comes from errno
not from the return of write()(check writeN()), so unseting the
expected errno so this do not cause tests to skips.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=112257
Cc: Jeevan B <jeevan.b@intel.com>
Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Diffstat (limited to 'lib/igt_psr.c')
-rw-r--r-- | lib/igt_psr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/igt_psr.c b/lib/igt_psr.c index 6d192689..83ccacdd 100644 --- a/lib/igt_psr.c +++ b/lib/igt_psr.c @@ -72,9 +72,10 @@ static int has_psr_debugfs(int debugfs_fd) * -ENODEV is returned when PSR is unavailable. */ ret = psr_write(debugfs_fd, "0xf"); - if (ret == -EINVAL) + if (ret == -EINVAL) { + errno = 0; return 0; - else if (ret < 0) + } else if (ret < 0) return ret; /* legacy debugfs api, we enabled irqs by writing, disable them. */ |