xref: /linux-6.15/include/linux/debugfs.h (revision 7c8d4698)
11da177e4SLinus Torvalds /*
21da177e4SLinus Torvalds  *  debugfs.h - a tiny little debug file system
31da177e4SLinus Torvalds  *
41da177e4SLinus Torvalds  *  Copyright (C) 2004 Greg Kroah-Hartman <[email protected]>
51da177e4SLinus Torvalds  *  Copyright (C) 2004 IBM Inc.
61da177e4SLinus Torvalds  *
71da177e4SLinus Torvalds  *	This program is free software; you can redistribute it and/or
81da177e4SLinus Torvalds  *	modify it under the terms of the GNU General Public License version
91da177e4SLinus Torvalds  *	2 as published by the Free Software Foundation.
101da177e4SLinus Torvalds  *
111da177e4SLinus Torvalds  *  debugfs is for people to use instead of /proc or /sys.
12e1b4fc7aSMauro Carvalho Chehab  *  See Documentation/filesystems/ for more details.
131da177e4SLinus Torvalds  */
141da177e4SLinus Torvalds 
151da177e4SLinus Torvalds #ifndef _DEBUGFS_H_
161da177e4SLinus Torvalds #define _DEBUGFS_H_
171da177e4SLinus Torvalds 
181da177e4SLinus Torvalds #include <linux/fs.h>
191a087c6aSAlessandro Rubini #include <linux/seq_file.h>
201da177e4SLinus Torvalds 
21a7a76cefSRoland Dreier #include <linux/types.h>
2249d200deSNicolai Stange #include <linux/compiler.h>
23a7a76cefSRoland Dreier 
24f30d0a81SArend van Spriel struct device;
25a7a76cefSRoland Dreier struct file_operations;
2649d200deSNicolai Stange struct srcu_struct;
27a7a76cefSRoland Dreier 
28dd308bc3SMichael Ellerman struct debugfs_blob_wrapper {
29dd308bc3SMichael Ellerman 	void *data;
30dd308bc3SMichael Ellerman 	unsigned long size;
31dd308bc3SMichael Ellerman };
32dd308bc3SMichael Ellerman 
331a087c6aSAlessandro Rubini struct debugfs_reg32 {
341a087c6aSAlessandro Rubini 	char *name;
351a087c6aSAlessandro Rubini 	unsigned long offset;
361a087c6aSAlessandro Rubini };
371a087c6aSAlessandro Rubini 
381a087c6aSAlessandro Rubini struct debugfs_regset32 {
39833d6e01SFelipe Balbi 	const struct debugfs_reg32 *regs;
401a087c6aSAlessandro Rubini 	int nregs;
411a087c6aSAlessandro Rubini 	void __iomem *base;
421a087c6aSAlessandro Rubini };
431a087c6aSAlessandro Rubini 
44ae79cdaaS[email protected] extern struct dentry *arch_debugfs_dir;
45ae79cdaaS[email protected] 
4649d200deSNicolai Stange extern struct srcu_struct debugfs_srcu;
4749d200deSNicolai Stange 
487f847dd3SArnd Bergmann #define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt)		\
497f847dd3SArnd Bergmann static int __fops ## _open(struct inode *inode, struct file *file)	\
507f847dd3SArnd Bergmann {									\
517f847dd3SArnd Bergmann 	__simple_attr_check_format(__fmt, 0ull);			\
527f847dd3SArnd Bergmann 	return simple_attr_open(inode, file, __get, __set, __fmt);	\
537f847dd3SArnd Bergmann }									\
547f847dd3SArnd Bergmann static const struct file_operations __fops = {				\
557f847dd3SArnd Bergmann 	.owner	 = THIS_MODULE,						\
567f847dd3SArnd Bergmann 	.open	 = __fops ## _open,					\
577f847dd3SArnd Bergmann 	.release = simple_attr_release,					\
587f847dd3SArnd Bergmann 	.read	 = debugfs_attr_read,					\
597f847dd3SArnd Bergmann 	.write	 = debugfs_attr_write,					\
60895ce6c8SGeliang Tang 	.llseek  = no_llseek,						\
617f847dd3SArnd Bergmann }
627f847dd3SArnd Bergmann 
631da177e4SLinus Torvalds #if defined(CONFIG_DEBUG_FS)
643634634eSHarvey Harrison 
65a7c5437bSOmar Sandoval struct dentry *debugfs_lookup(const char *name, struct dentry *parent);
66a7c5437bSOmar Sandoval 
67f4ae40a6SAl Viro struct dentry *debugfs_create_file(const char *name, umode_t mode,
681da177e4SLinus Torvalds 				   struct dentry *parent, void *data,
6999ac48f5SArjan van de Ven 				   const struct file_operations *fops);
70c6468808SNicolai Stange struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode,
71c6468808SNicolai Stange 				   struct dentry *parent, void *data,
72c6468808SNicolai Stange 				   const struct file_operations *fops);
731da177e4SLinus Torvalds 
74e59b4e91SDavid Howells struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
75e59b4e91SDavid Howells 					struct dentry *parent, void *data,
76e59b4e91SDavid Howells 					const struct file_operations *fops,
77e59b4e91SDavid Howells 					loff_t file_size);
78e59b4e91SDavid Howells 
791da177e4SLinus Torvalds struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
801da177e4SLinus Torvalds 
8166f54963SPeter Oberparleiter struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
8266f54963SPeter Oberparleiter 				      const char *dest);
8366f54963SPeter Oberparleiter 
8493faccbbSEric W. Biederman typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
8577b3da6eSAl Viro struct dentry *debugfs_create_automount(const char *name,
8677b3da6eSAl Viro 					struct dentry *parent,
8793faccbbSEric W. Biederman 					debugfs_automount_t f,
8877b3da6eSAl Viro 					void *data);
8977b3da6eSAl Viro 
901da177e4SLinus Torvalds void debugfs_remove(struct dentry *dentry);
919505e637SHaavard Skinnemoen void debugfs_remove_recursive(struct dentry *dentry);
921da177e4SLinus Torvalds 
9349d200deSNicolai Stange int debugfs_use_file_start(const struct dentry *dentry, int *srcu_idx)
9449d200deSNicolai Stange 	__acquires(&debugfs_srcu);
9549d200deSNicolai Stange 
9649d200deSNicolai Stange void debugfs_use_file_finish(int srcu_idx) __releases(&debugfs_srcu);
9749d200deSNicolai Stange 
98*7c8d4698SNicolai Stange const struct file_operations *debugfs_real_fops(const struct file *filp)
99*7c8d4698SNicolai Stange 	__must_hold(&debugfs_srcu);
100*7c8d4698SNicolai Stange 
101c6468808SNicolai Stange ssize_t debugfs_attr_read(struct file *file, char __user *buf,
102c6468808SNicolai Stange 			size_t len, loff_t *ppos);
103c6468808SNicolai Stange ssize_t debugfs_attr_write(struct file *file, const char __user *buf,
104c6468808SNicolai Stange 			size_t len, loff_t *ppos);
105c6468808SNicolai Stange 
106cfc94cdfSJan Kara struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
107cfc94cdfSJan Kara                 struct dentry *new_dir, const char *new_name);
108cfc94cdfSJan Kara 
109f4ae40a6SAl Viro struct dentry *debugfs_create_u8(const char *name, umode_t mode,
1101da177e4SLinus Torvalds 				 struct dentry *parent, u8 *value);
111f4ae40a6SAl Viro struct dentry *debugfs_create_u16(const char *name, umode_t mode,
1121da177e4SLinus Torvalds 				  struct dentry *parent, u16 *value);
113f4ae40a6SAl Viro struct dentry *debugfs_create_u32(const char *name, umode_t mode,
1141da177e4SLinus Torvalds 				  struct dentry *parent, u32 *value);
115f4ae40a6SAl Viro struct dentry *debugfs_create_u64(const char *name, umode_t mode,
1168447891fSMichael Ellerman 				  struct dentry *parent, u64 *value);
117c23fe831SViresh Kumar struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
118c23fe831SViresh Kumar 				    struct dentry *parent, unsigned long *value);
119f4ae40a6SAl Viro struct dentry *debugfs_create_x8(const char *name, umode_t mode,
1202ebefc50SRobin Getz 				 struct dentry *parent, u8 *value);
121f4ae40a6SAl Viro struct dentry *debugfs_create_x16(const char *name, umode_t mode,
1222ebefc50SRobin Getz 				  struct dentry *parent, u16 *value);
123f4ae40a6SAl Viro struct dentry *debugfs_create_x32(const char *name, umode_t mode,
1242ebefc50SRobin Getz 				  struct dentry *parent, u32 *value);
125f4ae40a6SAl Viro struct dentry *debugfs_create_x64(const char *name, umode_t mode,
12615b0beaaSHuang Ying 				  struct dentry *parent, u64 *value);
127f4ae40a6SAl Viro struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
1285e078787SInaky Perez-Gonzalez 				     struct dentry *parent, size_t *value);
1293a76e5e0SSeth Jennings struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
1303a76e5e0SSeth Jennings 				     struct dentry *parent, atomic_t *value);
131f4ae40a6SAl Viro struct dentry *debugfs_create_bool(const char *name, umode_t mode,
132621a5f7aSViresh Kumar 				  struct dentry *parent, bool *value);
1331da177e4SLinus Torvalds 
134f4ae40a6SAl Viro struct dentry *debugfs_create_blob(const char *name, umode_t mode,
135dd308bc3SMichael Ellerman 				  struct dentry *parent,
136dd308bc3SMichael Ellerman 				  struct debugfs_blob_wrapper *blob);
137c0f92ba9SFrederic Weisbecker 
13888187398SAl Viro struct dentry *debugfs_create_regset32(const char *name, umode_t mode,
1391a087c6aSAlessandro Rubini 				     struct dentry *parent,
1401a087c6aSAlessandro Rubini 				     struct debugfs_regset32 *regset);
1411a087c6aSAlessandro Rubini 
1429761536eSJoe Perches void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
1431a087c6aSAlessandro Rubini 			  int nregs, void __iomem *base, char *prefix);
1441a087c6aSAlessandro Rubini 
1459fe2a701SSrivatsa Vaddagiri struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
1469fe2a701SSrivatsa Vaddagiri 					struct dentry *parent,
1479fe2a701SSrivatsa Vaddagiri 					u32 *array, u32 elements);
1489fe2a701SSrivatsa Vaddagiri 
14998210b7fSArend van Spriel struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
15098210b7fSArend van Spriel 					   struct dentry *parent,
15198210b7fSArend van Spriel 					   int (*read_fn)(struct seq_file *s,
15298210b7fSArend van Spriel 							  void *data));
15398210b7fSArend van Spriel 
154c0f92ba9SFrederic Weisbecker bool debugfs_initialized(void);
155c0f92ba9SFrederic Weisbecker 
1560642ef6fSRichard Fitzgerald ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf,
1570642ef6fSRichard Fitzgerald 			       size_t count, loff_t *ppos);
1580642ef6fSRichard Fitzgerald 
1590642ef6fSRichard Fitzgerald ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf,
1600642ef6fSRichard Fitzgerald 				size_t count, loff_t *ppos);
1610642ef6fSRichard Fitzgerald 
1621da177e4SLinus Torvalds #else
163a7a76cefSRoland Dreier 
164a7a76cefSRoland Dreier #include <linux/err.h>
165a7a76cefSRoland Dreier 
1661da177e4SLinus Torvalds /*
1671da177e4SLinus Torvalds  * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled
1681da177e4SLinus Torvalds  * so users have a chance to detect if there was a real error or not.  We don't
1691da177e4SLinus Torvalds  * want to duplicate the design decision mistakes of procfs and devfs again.
1701da177e4SLinus Torvalds  */
1711da177e4SLinus Torvalds 
172a7c5437bSOmar Sandoval static inline struct dentry *debugfs_lookup(const char *name,
173a7c5437bSOmar Sandoval 					    struct dentry *parent)
174a7c5437bSOmar Sandoval {
175a7c5437bSOmar Sandoval 	return ERR_PTR(-ENODEV);
176a7c5437bSOmar Sandoval }
177a7c5437bSOmar Sandoval 
178f4ae40a6SAl Viro static inline struct dentry *debugfs_create_file(const char *name, umode_t mode,
179bde11d79SJean Delvare 					struct dentry *parent, void *data,
180bde11d79SJean Delvare 					const struct file_operations *fops)
1811da177e4SLinus Torvalds {
1821da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
1831da177e4SLinus Torvalds }
1841da177e4SLinus Torvalds 
185c2a737ebSViresh Kumar static inline struct dentry *debugfs_create_file_unsafe(const char *name,
186c2a737ebSViresh Kumar 					umode_t mode, struct dentry *parent,
187c2a737ebSViresh Kumar 					void *data,
188c2a737ebSViresh Kumar 					const struct file_operations *fops)
189c2a737ebSViresh Kumar {
190c2a737ebSViresh Kumar 	return ERR_PTR(-ENODEV);
191c2a737ebSViresh Kumar }
192c2a737ebSViresh Kumar 
193e59b4e91SDavid Howells static inline struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
194e59b4e91SDavid Howells 					struct dentry *parent, void *data,
195e59b4e91SDavid Howells 					const struct file_operations *fops,
196e59b4e91SDavid Howells 					loff_t file_size)
197e59b4e91SDavid Howells {
198e59b4e91SDavid Howells 	return ERR_PTR(-ENODEV);
199e59b4e91SDavid Howells }
200e59b4e91SDavid Howells 
2011da177e4SLinus Torvalds static inline struct dentry *debugfs_create_dir(const char *name,
2021da177e4SLinus Torvalds 						struct dentry *parent)
2031da177e4SLinus Torvalds {
2041da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2051da177e4SLinus Torvalds }
2061da177e4SLinus Torvalds 
20766f54963SPeter Oberparleiter static inline struct dentry *debugfs_create_symlink(const char *name,
20866f54963SPeter Oberparleiter 						    struct dentry *parent,
20966f54963SPeter Oberparleiter 						    const char *dest)
21066f54963SPeter Oberparleiter {
21166f54963SPeter Oberparleiter 	return ERR_PTR(-ENODEV);
21266f54963SPeter Oberparleiter }
21366f54963SPeter Oberparleiter 
21494e1dec7SJiaxing Wang static inline struct dentry *debugfs_create_automount(const char *name,
21594e1dec7SJiaxing Wang 					struct dentry *parent,
21694e1dec7SJiaxing Wang 					struct vfsmount *(*f)(void *),
21794e1dec7SJiaxing Wang 					void *data)
21894e1dec7SJiaxing Wang {
21994e1dec7SJiaxing Wang 	return ERR_PTR(-ENODEV);
22094e1dec7SJiaxing Wang }
22194e1dec7SJiaxing Wang 
2221da177e4SLinus Torvalds static inline void debugfs_remove(struct dentry *dentry)
2231da177e4SLinus Torvalds { }
2241da177e4SLinus Torvalds 
2259505e637SHaavard Skinnemoen static inline void debugfs_remove_recursive(struct dentry *dentry)
2269505e637SHaavard Skinnemoen { }
2279505e637SHaavard Skinnemoen 
22849d200deSNicolai Stange static inline int debugfs_use_file_start(const struct dentry *dentry,
22949d200deSNicolai Stange 					int *srcu_idx)
23049d200deSNicolai Stange 	__acquires(&debugfs_srcu)
23149d200deSNicolai Stange {
23249d200deSNicolai Stange 	return 0;
23349d200deSNicolai Stange }
23449d200deSNicolai Stange 
23549d200deSNicolai Stange static inline void debugfs_use_file_finish(int srcu_idx)
23649d200deSNicolai Stange 	__releases(&debugfs_srcu)
23749d200deSNicolai Stange { }
23849d200deSNicolai Stange 
2397f847dd3SArnd Bergmann static inline ssize_t debugfs_attr_read(struct file *file, char __user *buf,
2407f847dd3SArnd Bergmann 					size_t len, loff_t *ppos)
2417f847dd3SArnd Bergmann {
2427f847dd3SArnd Bergmann 	return -ENODEV;
2437f847dd3SArnd Bergmann }
2447f847dd3SArnd Bergmann 
2457f847dd3SArnd Bergmann static inline ssize_t debugfs_attr_write(struct file *file,
2467f847dd3SArnd Bergmann 					const char __user *buf,
2477f847dd3SArnd Bergmann 					size_t len, loff_t *ppos)
2487f847dd3SArnd Bergmann {
2497f847dd3SArnd Bergmann 	return -ENODEV;
2507f847dd3SArnd Bergmann }
251c6468808SNicolai Stange 
252cfc94cdfSJan Kara static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
253cfc94cdfSJan Kara                 struct dentry *new_dir, char *new_name)
254cfc94cdfSJan Kara {
255cfc94cdfSJan Kara 	return ERR_PTR(-ENODEV);
256cfc94cdfSJan Kara }
257cfc94cdfSJan Kara 
258f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode,
2591da177e4SLinus Torvalds 					       struct dentry *parent,
2601da177e4SLinus Torvalds 					       u8 *value)
2611da177e4SLinus Torvalds {
2621da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2631da177e4SLinus Torvalds }
2641da177e4SLinus Torvalds 
265f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode,
2661da177e4SLinus Torvalds 						struct dentry *parent,
2677b558637SMichal Ostrowski 						u16 *value)
2681da177e4SLinus Torvalds {
2691da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2701da177e4SLinus Torvalds }
2711da177e4SLinus Torvalds 
272f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
2731da177e4SLinus Torvalds 						struct dentry *parent,
2747b558637SMichal Ostrowski 						u32 *value)
2751da177e4SLinus Torvalds {
2761da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2771da177e4SLinus Torvalds }
2781da177e4SLinus Torvalds 
279f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode,
2808447891fSMichael Ellerman 						struct dentry *parent,
2818447891fSMichael Ellerman 						u64 *value)
2828447891fSMichael Ellerman {
2838447891fSMichael Ellerman 	return ERR_PTR(-ENODEV);
2848447891fSMichael Ellerman }
2858447891fSMichael Ellerman 
286c2a737ebSViresh Kumar static inline struct dentry *debugfs_create_ulong(const char *name,
287c2a737ebSViresh Kumar 						umode_t mode,
288c2a737ebSViresh Kumar 						struct dentry *parent,
289c2a737ebSViresh Kumar 						unsigned long *value)
290c2a737ebSViresh Kumar {
291c2a737ebSViresh Kumar 	return ERR_PTR(-ENODEV);
292c2a737ebSViresh Kumar }
293c2a737ebSViresh Kumar 
294f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode,
2952ebefc50SRobin Getz 					       struct dentry *parent,
2962ebefc50SRobin Getz 					       u8 *value)
2972ebefc50SRobin Getz {
2982ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
2992ebefc50SRobin Getz }
3002ebefc50SRobin Getz 
301f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode,
3022ebefc50SRobin Getz 						struct dentry *parent,
3032ebefc50SRobin Getz 						u16 *value)
3042ebefc50SRobin Getz {
3052ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
3062ebefc50SRobin Getz }
3072ebefc50SRobin Getz 
308f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode,
3092ebefc50SRobin Getz 						struct dentry *parent,
3102ebefc50SRobin Getz 						u32 *value)
3112ebefc50SRobin Getz {
3122ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
3132ebefc50SRobin Getz }
3142ebefc50SRobin Getz 
3153159269eSJohannes Berg static inline struct dentry *debugfs_create_x64(const char *name, umode_t mode,
3163159269eSJohannes Berg 						struct dentry *parent,
3173159269eSJohannes Berg 						u64 *value)
3183159269eSJohannes Berg {
3193159269eSJohannes Berg 	return ERR_PTR(-ENODEV);
3203159269eSJohannes Berg }
3213159269eSJohannes Berg 
322f4ae40a6SAl Viro static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
3238adb711fSInaky Perez-Gonzalez 				     struct dentry *parent,
3248adb711fSInaky Perez-Gonzalez 				     size_t *value)
3258adb711fSInaky Perez-Gonzalez {
3268adb711fSInaky Perez-Gonzalez 	return ERR_PTR(-ENODEV);
3278adb711fSInaky Perez-Gonzalez }
3288adb711fSInaky Perez-Gonzalez 
3295b880214SWeijie Yang static inline struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
3305b880214SWeijie Yang 				     struct dentry *parent, atomic_t *value)
3315b880214SWeijie Yang {
3325b880214SWeijie Yang 	return ERR_PTR(-ENODEV);
3335b880214SWeijie Yang }
3345b880214SWeijie Yang 
335f4ae40a6SAl Viro static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode,
3361da177e4SLinus Torvalds 						 struct dentry *parent,
337621a5f7aSViresh Kumar 						 bool *value)
3381da177e4SLinus Torvalds {
3391da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
3401da177e4SLinus Torvalds }
3411da177e4SLinus Torvalds 
342f4ae40a6SAl Viro static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode,
343dd308bc3SMichael Ellerman 				  struct dentry *parent,
344dd308bc3SMichael Ellerman 				  struct debugfs_blob_wrapper *blob)
345dd308bc3SMichael Ellerman {
346dd308bc3SMichael Ellerman 	return ERR_PTR(-ENODEV);
347dd308bc3SMichael Ellerman }
348dd308bc3SMichael Ellerman 
3491a087c6aSAlessandro Rubini static inline struct dentry *debugfs_create_regset32(const char *name,
35088187398SAl Viro 				   umode_t mode, struct dentry *parent,
3511a087c6aSAlessandro Rubini 				   struct debugfs_regset32 *regset)
3521a087c6aSAlessandro Rubini {
3531a087c6aSAlessandro Rubini 	return ERR_PTR(-ENODEV);
3541a087c6aSAlessandro Rubini }
3551a087c6aSAlessandro Rubini 
3569761536eSJoe Perches static inline void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
3575b880214SWeijie Yang 			 int nregs, void __iomem *base, char *prefix)
3585b880214SWeijie Yang {
3595b880214SWeijie Yang }
3605b880214SWeijie Yang 
361c0f92ba9SFrederic Weisbecker static inline bool debugfs_initialized(void)
362c0f92ba9SFrederic Weisbecker {
363c0f92ba9SFrederic Weisbecker 	return false;
364c0f92ba9SFrederic Weisbecker }
365c0f92ba9SFrederic Weisbecker 
3669fe2a701SSrivatsa Vaddagiri static inline struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
3679fe2a701SSrivatsa Vaddagiri 					struct dentry *parent,
3689fe2a701SSrivatsa Vaddagiri 					u32 *array, u32 elements)
3699fe2a701SSrivatsa Vaddagiri {
3709fe2a701SSrivatsa Vaddagiri 	return ERR_PTR(-ENODEV);
3719fe2a701SSrivatsa Vaddagiri }
3729fe2a701SSrivatsa Vaddagiri 
37398210b7fSArend van Spriel static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,
37498210b7fSArend van Spriel 							 const char *name,
37598210b7fSArend van Spriel 							 struct dentry *parent,
37698210b7fSArend van Spriel 					   int (*read_fn)(struct seq_file *s,
37798210b7fSArend van Spriel 							  void *data))
37898210b7fSArend van Spriel {
37998210b7fSArend van Spriel 	return ERR_PTR(-ENODEV);
38098210b7fSArend van Spriel }
38198210b7fSArend van Spriel 
3820642ef6fSRichard Fitzgerald static inline ssize_t debugfs_read_file_bool(struct file *file,
3830642ef6fSRichard Fitzgerald 					     char __user *user_buf,
3840642ef6fSRichard Fitzgerald 					     size_t count, loff_t *ppos)
3850642ef6fSRichard Fitzgerald {
3860642ef6fSRichard Fitzgerald 	return -ENODEV;
3870642ef6fSRichard Fitzgerald }
3880642ef6fSRichard Fitzgerald 
3890642ef6fSRichard Fitzgerald static inline ssize_t debugfs_write_file_bool(struct file *file,
3900642ef6fSRichard Fitzgerald 					      const char __user *user_buf,
3910642ef6fSRichard Fitzgerald 					      size_t count, loff_t *ppos)
3920642ef6fSRichard Fitzgerald {
3930642ef6fSRichard Fitzgerald 	return -ENODEV;
3940642ef6fSRichard Fitzgerald }
3950642ef6fSRichard Fitzgerald 
3961da177e4SLinus Torvalds #endif
3971da177e4SLinus Torvalds 
3981da177e4SLinus Torvalds #endif
399