Skip to content

Commit

Permalink
vga_switcheroo: Remove unnecessary checks
Browse files Browse the repository at this point in the history
debugfs_remove() gracefully ignores NULL parameters, so the explicit
checks can be removed.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Thierry Reding authored and Daniel Vetter committed Aug 12, 2015
1 parent 7491bfb commit 798ae0f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/gpu/vga/vga_switcheroo.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,14 +525,11 @@ static const struct file_operations vga_switcheroo_debugfs_fops = {

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

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

static int vga_switcheroo_debugfs_init(struct vgasr_priv *priv)
Expand Down

0 comments on commit 798ae0f

Please sign in to comment.