[PATCH 4/4] vgaswitcheroo: do not check for NULL debugfs dentry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Debugfs APIs returns encoded error on failure so use
debugfs_lookup() instead of checking for NULL.

CC: Lukas Wunner <lukas@xxxxxxxxx>
CC: David Airlie <airlied@xxxxxxxx>
CC: Daniel Vetter <daniel@xxxxxxxx>
CC: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
CC: Maxime Ripard <mripard@xxxxxxxxxx>
CC: Thomas Zimmermann <tzimmermann@xxxxxxx>

Signed-off-by: Nirmoy Das <nirmoy.das@xxxxxxx>
---
 drivers/gpu/vga/vga_switcheroo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 365e6ddbe90f..a331525f0b32 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -914,7 +914,7 @@ static void vga_switcheroo_debugfs_fini(struct vgasr_priv *priv)
 static void vga_switcheroo_debugfs_init(struct vgasr_priv *priv)
 {
 	/* already initialised */
-	if (priv->debugfs_root)
+	if (debugfs_lookup("vgaswitcheroo", NULL))
 		return;

 	priv->debugfs_root = debugfs_create_dir("vgaswitcheroo", NULL);
--
2.32.0




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux