summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/vga
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2015-08-12 16:32:12 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-08-12 17:13:19 +0200
commit798ae0f6693deac4a07377d0c45b4325b7026278 (patch)
tree14fc1551e7883b110ed43526643ebaf811c436df /drivers/gpu/vga
parent7491bfb446741b1dd65aadda54bade18bfaba442 (diff)
downloadlinux-798ae0f6693deac4a07377d0c45b4325b7026278.tar.bz2
vga_switcheroo: Remove unnecessary checks
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>
Diffstat (limited to 'drivers/gpu/vga')
-rw-r--r--drivers/gpu/vga/vga_switcheroo.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index c7771466595f..21060668fd25 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -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)