Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 798ae0f6 authored by Thierry Reding's avatar Thierry Reding Committed by Daniel Vetter
Browse files

vga_switcheroo: Remove unnecessary checks



debugfs_remove() gracefully ignores NULL parameters, so the explicit
checks can be removed.

Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 7491bfb4
Loading
Loading
Loading
Loading
+5 −8
Original line number Original line Diff line number Diff line
@@ -525,15 +525,12 @@ static const struct file_operations vga_switcheroo_debugfs_fops = {


static void vga_switcheroo_debugfs_fini(struct vgasr_priv *priv)
static void vga_switcheroo_debugfs_fini(struct vgasr_priv *priv)
{
{
	if (priv->switch_file) {
	debugfs_remove(priv->switch_file);
	debugfs_remove(priv->switch_file);
	priv->switch_file = NULL;
	priv->switch_file = NULL;
	}

	if (priv->debugfs_root) {
	debugfs_remove(priv->debugfs_root);
	debugfs_remove(priv->debugfs_root);
	priv->debugfs_root = NULL;
	priv->debugfs_root = NULL;
}
}
}


static int vga_switcheroo_debugfs_init(struct vgasr_priv *priv)
static int vga_switcheroo_debugfs_init(struct vgasr_priv *priv)
{
{