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

Commit 7a842a7b authored by Lynus Vaz's avatar Lynus Vaz
Browse files

msm: kgsl: Clean up device debugfs files on removal



Remove the kgsl device-specific debugfs files in the device removal
sequence, and also if probe fails.

Change-Id: I4d5e9ec33a887f29c14bac513c4faf75266e990b
Signed-off-by: default avatarLynus Vaz <lvaz@codeaurora.org>
parent 3a7e7526
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4752,6 +4752,7 @@ error_close_mmu:
error_pwrctrl_close:
	kgsl_pwrctrl_close(device);
error:
	kgsl_device_debugfs_close(device);
	_unregister_device(device);
	return status;
}
@@ -4781,6 +4782,7 @@ void kgsl_device_platform_remove(struct kgsl_device *device)

	kgsl_pwrctrl_close(device);

	kgsl_device_debugfs_close(device);
	_unregister_device(device);
}
EXPORT_SYMBOL(kgsl_device_platform_remove);
+6 −1
Original line number Diff line number Diff line
/* Copyright (c) 2002,2008-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2008-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -87,6 +87,11 @@ void kgsl_device_debugfs_init(struct kgsl_device *device)
				&pwr_log_fops);
}

void kgsl_device_debugfs_close(struct kgsl_device *device)
{
	debugfs_remove_recursive(device->d_debugfs);
}

struct type_entry {
	int type;
	const char *str;
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2002,2008-2011,2013,2015 The Linux Foundation.
/* Copyright (c) 2002,2008-2011,2013,2015,2017 The Linux Foundation.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
@@ -23,6 +23,7 @@ void kgsl_core_debugfs_init(void);
void kgsl_core_debugfs_close(void);

void kgsl_device_debugfs_init(struct kgsl_device *device);
void kgsl_device_debugfs_close(struct kgsl_device *device);

extern struct dentry *kgsl_debugfs_dir;
static inline struct dentry *kgsl_get_debugfs_dir(void)
@@ -34,6 +35,7 @@ void kgsl_process_init_debugfs(struct kgsl_process_private *);
#else
static inline void kgsl_core_debugfs_init(void) { }
static inline void kgsl_device_debugfs_init(struct kgsl_device *device) { }
static inline void kgsl_device_debugfs_close(struct kgsl_device *device) { }
static inline void kgsl_core_debugfs_close(void) { }
static inline struct dentry *kgsl_get_debugfs_dir(void) { return NULL; }
static inline void kgsl_process_init_debugfs(struct kgsl_process_private *priv)