summaryrefslogtreecommitdiff
path: root/lib/igt_sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/igt_sysfs.c')
-rw-r--r--lib/igt_sysfs.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index d323b81d..cce342a0 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -189,7 +189,7 @@ bool igt_sysfs_set_parameter(int device,
/**
* igt_sysfs_open_parameters:
- * @device: fd of the device (or -1 to default to Intel)
+ * @device: fd of the device
*
* This opens the module parameters directory (under sysfs) corresponding
* to the device for use with igt_sysfs_set() and igt_sysfs_get().
@@ -199,15 +199,15 @@ bool igt_sysfs_set_parameter(int device,
*/
int igt_sysfs_open_parameters(int device)
{
- int dir, params;
+ int dir, params = -1;
dir = igt_sysfs_open(device, &params);
- if (dir < 0)
- return -1;
-
- params = -1;
- //params = openat(dir, "device/driver/module/parameters", O_RDONLY);
- close(dir);
+ if (dir >= 0) {
+ params = openat(dir,
+ "device/driver/module/parameters",
+ O_RDONLY);
+ close(dir);
+ }
if (params < 0) { /* builtin? */
drm_version_t version;