xref: /linux-6.15/include/linux/debugfs.h (revision 68f929ff)
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.
1255dff495SRandy Dunlap  *  See Documentation/DocBook/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 
4886f0e067SChristian Lamparter /**
4986f0e067SChristian Lamparter  * debugfs_real_fops - getter for the real file operation
5086f0e067SChristian Lamparter  * @filp: a pointer to a struct file
5186f0e067SChristian Lamparter  *
5286f0e067SChristian Lamparter  * Must only be called under the protection established by
5386f0e067SChristian Lamparter  * debugfs_use_file_start().
5486f0e067SChristian Lamparter  */
55*68f929ffSJakub Kicinski static inline const struct file_operations *
56*68f929ffSJakub Kicinski debugfs_real_fops(const struct file *filp)
5786f0e067SChristian Lamparter 	__must_hold(&debugfs_srcu)
5886f0e067SChristian Lamparter {
5986f0e067SChristian Lamparter 	/*
6086f0e067SChristian Lamparter 	 * Neither the pointer to the struct file_operations, nor its
6186f0e067SChristian Lamparter 	 * contents ever change -- srcu_dereference() is not needed here.
6286f0e067SChristian Lamparter 	 */
6386f0e067SChristian Lamparter 	return filp->f_path.dentry->d_fsdata;
6486f0e067SChristian Lamparter }
6586f0e067SChristian Lamparter 
661da177e4SLinus Torvalds #if defined(CONFIG_DEBUG_FS)
673634634eSHarvey Harrison 
68f4ae40a6SAl Viro struct dentry *debugfs_create_file(const char *name, umode_t mode,
691da177e4SLinus Torvalds 				   struct dentry *parent, void *data,
7099ac48f5SArjan van de Ven 				   const struct file_operations *fops);
71c6468808SNicolai Stange struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode,
72c6468808SNicolai Stange 				   struct dentry *parent, void *data,
73c6468808SNicolai Stange 				   const struct file_operations *fops);
741da177e4SLinus Torvalds 
75e59b4e91SDavid Howells struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
76e59b4e91SDavid Howells 					struct dentry *parent, void *data,
77e59b4e91SDavid Howells 					const struct file_operations *fops,
78e59b4e91SDavid Howells 					loff_t file_size);
79e59b4e91SDavid Howells 
801da177e4SLinus Torvalds struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
811da177e4SLinus Torvalds 
8266f54963SPeter Oberparleiter struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
8366f54963SPeter Oberparleiter 				      const char *dest);
8466f54963SPeter Oberparleiter 
8577b3da6eSAl Viro struct dentry *debugfs_create_automount(const char *name,
8677b3da6eSAl Viro 					struct dentry *parent,
8777b3da6eSAl Viro 					struct vfsmount *(*f)(void *),
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 
98c6468808SNicolai Stange ssize_t debugfs_attr_read(struct file *file, char __user *buf,
99c6468808SNicolai Stange 			size_t len, loff_t *ppos);
100c6468808SNicolai Stange ssize_t debugfs_attr_write(struct file *file, const char __user *buf,
101c6468808SNicolai Stange 			size_t len, loff_t *ppos);
102c6468808SNicolai Stange 
103c6468808SNicolai Stange #define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt)		\
104c6468808SNicolai Stange static int __fops ## _open(struct inode *inode, struct file *file)	\
105c6468808SNicolai Stange {									\
106c6468808SNicolai Stange 	__simple_attr_check_format(__fmt, 0ull);			\
107c6468808SNicolai Stange 	return simple_attr_open(inode, file, __get, __set, __fmt);	\
108c6468808SNicolai Stange }									\
109c6468808SNicolai Stange static const struct file_operations __fops = {				\
110c6468808SNicolai Stange 	.owner	 = THIS_MODULE,					\
111c6468808SNicolai Stange 	.open	 = __fops ## _open,					\
112c6468808SNicolai Stange 	.release = simple_attr_release,				\
113c6468808SNicolai Stange 	.read	 = debugfs_attr_read,					\
114c6468808SNicolai Stange 	.write	 = debugfs_attr_write,					\
115c6468808SNicolai Stange 	.llseek  = generic_file_llseek,				\
116c6468808SNicolai Stange }
117c6468808SNicolai Stange 
118cfc94cdfSJan Kara struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
119cfc94cdfSJan Kara                 struct dentry *new_dir, const char *new_name);
120cfc94cdfSJan Kara 
121f4ae40a6SAl Viro struct dentry *debugfs_create_u8(const char *name, umode_t mode,
1221da177e4SLinus Torvalds 				 struct dentry *parent, u8 *value);
123f4ae40a6SAl Viro struct dentry *debugfs_create_u16(const char *name, umode_t mode,
1241da177e4SLinus Torvalds 				  struct dentry *parent, u16 *value);
125f4ae40a6SAl Viro struct dentry *debugfs_create_u32(const char *name, umode_t mode,
1261da177e4SLinus Torvalds 				  struct dentry *parent, u32 *value);
127f4ae40a6SAl Viro struct dentry *debugfs_create_u64(const char *name, umode_t mode,
1288447891fSMichael Ellerman 				  struct dentry *parent, u64 *value);
129c23fe831SViresh Kumar struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
130c23fe831SViresh Kumar 				    struct dentry *parent, unsigned long *value);
131f4ae40a6SAl Viro struct dentry *debugfs_create_x8(const char *name, umode_t mode,
1322ebefc50SRobin Getz 				 struct dentry *parent, u8 *value);
133f4ae40a6SAl Viro struct dentry *debugfs_create_x16(const char *name, umode_t mode,
1342ebefc50SRobin Getz 				  struct dentry *parent, u16 *value);
135f4ae40a6SAl Viro struct dentry *debugfs_create_x32(const char *name, umode_t mode,
1362ebefc50SRobin Getz 				  struct dentry *parent, u32 *value);
137f4ae40a6SAl Viro struct dentry *debugfs_create_x64(const char *name, umode_t mode,
13815b0beaaSHuang Ying 				  struct dentry *parent, u64 *value);
139f4ae40a6SAl Viro struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
1405e078787SInaky Perez-Gonzalez 				     struct dentry *parent, size_t *value);
1413a76e5e0SSeth Jennings struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
1423a76e5e0SSeth Jennings 				     struct dentry *parent, atomic_t *value);
143f4ae40a6SAl Viro struct dentry *debugfs_create_bool(const char *name, umode_t mode,
144621a5f7aSViresh Kumar 				  struct dentry *parent, bool *value);
1451da177e4SLinus Torvalds 
146f4ae40a6SAl Viro struct dentry *debugfs_create_blob(const char *name, umode_t mode,
147dd308bc3SMichael Ellerman 				  struct dentry *parent,
148dd308bc3SMichael Ellerman 				  struct debugfs_blob_wrapper *blob);
149c0f92ba9SFrederic Weisbecker 
15088187398SAl Viro struct dentry *debugfs_create_regset32(const char *name, umode_t mode,
1511a087c6aSAlessandro Rubini 				     struct dentry *parent,
1521a087c6aSAlessandro Rubini 				     struct debugfs_regset32 *regset);
1531a087c6aSAlessandro Rubini 
1549761536eSJoe Perches void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
1551a087c6aSAlessandro Rubini 			  int nregs, void __iomem *base, char *prefix);
1561a087c6aSAlessandro Rubini 
1579fe2a701SSrivatsa Vaddagiri struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
1589fe2a701SSrivatsa Vaddagiri 					struct dentry *parent,
1599fe2a701SSrivatsa Vaddagiri 					u32 *array, u32 elements);
1609fe2a701SSrivatsa Vaddagiri 
16198210b7fSArend van Spriel struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
16298210b7fSArend van Spriel 					   struct dentry *parent,
16398210b7fSArend van Spriel 					   int (*read_fn)(struct seq_file *s,
16498210b7fSArend van Spriel 							  void *data));
16598210b7fSArend van Spriel 
166c0f92ba9SFrederic Weisbecker bool debugfs_initialized(void);
167c0f92ba9SFrederic Weisbecker 
1680642ef6fSRichard Fitzgerald ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf,
1690642ef6fSRichard Fitzgerald 			       size_t count, loff_t *ppos);
1700642ef6fSRichard Fitzgerald 
1710642ef6fSRichard Fitzgerald ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf,
1720642ef6fSRichard Fitzgerald 				size_t count, loff_t *ppos);
1730642ef6fSRichard Fitzgerald 
1741da177e4SLinus Torvalds #else
175a7a76cefSRoland Dreier 
176a7a76cefSRoland Dreier #include <linux/err.h>
177a7a76cefSRoland Dreier 
1781da177e4SLinus Torvalds /*
1791da177e4SLinus Torvalds  * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled
1801da177e4SLinus Torvalds  * so users have a chance to detect if there was a real error or not.  We don't
1811da177e4SLinus Torvalds  * want to duplicate the design decision mistakes of procfs and devfs again.
1821da177e4SLinus Torvalds  */
1831da177e4SLinus Torvalds 
184f4ae40a6SAl Viro static inline struct dentry *debugfs_create_file(const char *name, umode_t mode,
185bde11d79SJean Delvare 					struct dentry *parent, void *data,
186bde11d79SJean Delvare 					const struct file_operations *fops)
1871da177e4SLinus Torvalds {
1881da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
1891da177e4SLinus Torvalds }
1901da177e4SLinus Torvalds 
191e59b4e91SDavid Howells static inline struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
192e59b4e91SDavid Howells 					struct dentry *parent, void *data,
193e59b4e91SDavid Howells 					const struct file_operations *fops,
194e59b4e91SDavid Howells 					loff_t file_size)
195e59b4e91SDavid Howells {
196e59b4e91SDavid Howells 	return ERR_PTR(-ENODEV);
197e59b4e91SDavid Howells }
198e59b4e91SDavid Howells 
1991da177e4SLinus Torvalds static inline struct dentry *debugfs_create_dir(const char *name,
2001da177e4SLinus Torvalds 						struct dentry *parent)
2011da177e4SLinus Torvalds {
2021da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2031da177e4SLinus Torvalds }
2041da177e4SLinus Torvalds 
20566f54963SPeter Oberparleiter static inline struct dentry *debugfs_create_symlink(const char *name,
20666f54963SPeter Oberparleiter 						    struct dentry *parent,
20766f54963SPeter Oberparleiter 						    const char *dest)
20866f54963SPeter Oberparleiter {
20966f54963SPeter Oberparleiter 	return ERR_PTR(-ENODEV);
21066f54963SPeter Oberparleiter }
21166f54963SPeter Oberparleiter 
21294e1dec7SJiaxing Wang static inline struct dentry *debugfs_create_automount(const char *name,
21394e1dec7SJiaxing Wang 					struct dentry *parent,
21494e1dec7SJiaxing Wang 					struct vfsmount *(*f)(void *),
21594e1dec7SJiaxing Wang 					void *data)
21694e1dec7SJiaxing Wang {
21794e1dec7SJiaxing Wang 	return ERR_PTR(-ENODEV);
21894e1dec7SJiaxing Wang }
21994e1dec7SJiaxing Wang 
2201da177e4SLinus Torvalds static inline void debugfs_remove(struct dentry *dentry)
2211da177e4SLinus Torvalds { }
2221da177e4SLinus Torvalds 
2239505e637SHaavard Skinnemoen static inline void debugfs_remove_recursive(struct dentry *dentry)
2249505e637SHaavard Skinnemoen { }
2259505e637SHaavard Skinnemoen 
22649d200deSNicolai Stange static inline int debugfs_use_file_start(const struct dentry *dentry,
22749d200deSNicolai Stange 					int *srcu_idx)
22849d200deSNicolai Stange 	__acquires(&debugfs_srcu)
22949d200deSNicolai Stange {
23049d200deSNicolai Stange 	return 0;
23149d200deSNicolai Stange }
23249d200deSNicolai Stange 
23349d200deSNicolai Stange static inline void debugfs_use_file_finish(int srcu_idx)
23449d200deSNicolai Stange 	__releases(&debugfs_srcu)
23549d200deSNicolai Stange { }
23649d200deSNicolai Stange 
237c6468808SNicolai Stange #define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt)	\
238c6468808SNicolai Stange 	static const struct file_operations __fops = { 0 }
239c6468808SNicolai Stange 
240cfc94cdfSJan Kara static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
241cfc94cdfSJan Kara                 struct dentry *new_dir, char *new_name)
242cfc94cdfSJan Kara {
243cfc94cdfSJan Kara 	return ERR_PTR(-ENODEV);
244cfc94cdfSJan Kara }
245cfc94cdfSJan Kara 
246f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode,
2471da177e4SLinus Torvalds 					       struct dentry *parent,
2481da177e4SLinus Torvalds 					       u8 *value)
2491da177e4SLinus Torvalds {
2501da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2511da177e4SLinus Torvalds }
2521da177e4SLinus Torvalds 
253f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode,
2541da177e4SLinus Torvalds 						struct dentry *parent,
2557b558637SMichal Ostrowski 						u16 *value)
2561da177e4SLinus Torvalds {
2571da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2581da177e4SLinus Torvalds }
2591da177e4SLinus Torvalds 
260f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
2611da177e4SLinus Torvalds 						struct dentry *parent,
2627b558637SMichal Ostrowski 						u32 *value)
2631da177e4SLinus Torvalds {
2641da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2651da177e4SLinus Torvalds }
2661da177e4SLinus Torvalds 
267f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode,
2688447891fSMichael Ellerman 						struct dentry *parent,
2698447891fSMichael Ellerman 						u64 *value)
2708447891fSMichael Ellerman {
2718447891fSMichael Ellerman 	return ERR_PTR(-ENODEV);
2728447891fSMichael Ellerman }
2738447891fSMichael Ellerman 
274f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode,
2752ebefc50SRobin Getz 					       struct dentry *parent,
2762ebefc50SRobin Getz 					       u8 *value)
2772ebefc50SRobin Getz {
2782ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
2792ebefc50SRobin Getz }
2802ebefc50SRobin Getz 
281f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode,
2822ebefc50SRobin Getz 						struct dentry *parent,
2832ebefc50SRobin Getz 						u16 *value)
2842ebefc50SRobin Getz {
2852ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
2862ebefc50SRobin Getz }
2872ebefc50SRobin Getz 
288f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode,
2892ebefc50SRobin Getz 						struct dentry *parent,
2902ebefc50SRobin Getz 						u32 *value)
2912ebefc50SRobin Getz {
2922ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
2932ebefc50SRobin Getz }
2942ebefc50SRobin Getz 
2953159269eSJohannes Berg static inline struct dentry *debugfs_create_x64(const char *name, umode_t mode,
2963159269eSJohannes Berg 						struct dentry *parent,
2973159269eSJohannes Berg 						u64 *value)
2983159269eSJohannes Berg {
2993159269eSJohannes Berg 	return ERR_PTR(-ENODEV);
3003159269eSJohannes Berg }
3013159269eSJohannes Berg 
302f4ae40a6SAl Viro static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
3038adb711fSInaky Perez-Gonzalez 				     struct dentry *parent,
3048adb711fSInaky Perez-Gonzalez 				     size_t *value)
3058adb711fSInaky Perez-Gonzalez {
3068adb711fSInaky Perez-Gonzalez 	return ERR_PTR(-ENODEV);
3078adb711fSInaky Perez-Gonzalez }
3088adb711fSInaky Perez-Gonzalez 
3095b880214SWeijie Yang static inline struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
3105b880214SWeijie Yang 				     struct dentry *parent, atomic_t *value)
3115b880214SWeijie Yang {
3125b880214SWeijie Yang 	return ERR_PTR(-ENODEV);
3135b880214SWeijie Yang }
3145b880214SWeijie Yang 
315f4ae40a6SAl Viro static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode,
3161da177e4SLinus Torvalds 						 struct dentry *parent,
317621a5f7aSViresh Kumar 						 bool *value)
3181da177e4SLinus Torvalds {
3191da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
3201da177e4SLinus Torvalds }
3211da177e4SLinus Torvalds 
322f4ae40a6SAl Viro static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode,
323dd308bc3SMichael Ellerman 				  struct dentry *parent,
324dd308bc3SMichael Ellerman 				  struct debugfs_blob_wrapper *blob)
325dd308bc3SMichael Ellerman {
326dd308bc3SMichael Ellerman 	return ERR_PTR(-ENODEV);
327dd308bc3SMichael Ellerman }
328dd308bc3SMichael Ellerman 
3291a087c6aSAlessandro Rubini static inline struct dentry *debugfs_create_regset32(const char *name,
33088187398SAl Viro 				   umode_t mode, struct dentry *parent,
3311a087c6aSAlessandro Rubini 				   struct debugfs_regset32 *regset)
3321a087c6aSAlessandro Rubini {
3331a087c6aSAlessandro Rubini 	return ERR_PTR(-ENODEV);
3341a087c6aSAlessandro Rubini }
3351a087c6aSAlessandro Rubini 
3369761536eSJoe Perches static inline void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
3375b880214SWeijie Yang 			 int nregs, void __iomem *base, char *prefix)
3385b880214SWeijie Yang {
3395b880214SWeijie Yang }
3405b880214SWeijie Yang 
341c0f92ba9SFrederic Weisbecker static inline bool debugfs_initialized(void)
342c0f92ba9SFrederic Weisbecker {
343c0f92ba9SFrederic Weisbecker 	return false;
344c0f92ba9SFrederic Weisbecker }
345c0f92ba9SFrederic Weisbecker 
3469fe2a701SSrivatsa Vaddagiri static inline struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
3479fe2a701SSrivatsa Vaddagiri 					struct dentry *parent,
3489fe2a701SSrivatsa Vaddagiri 					u32 *array, u32 elements)
3499fe2a701SSrivatsa Vaddagiri {
3509fe2a701SSrivatsa Vaddagiri 	return ERR_PTR(-ENODEV);
3519fe2a701SSrivatsa Vaddagiri }
3529fe2a701SSrivatsa Vaddagiri 
35398210b7fSArend van Spriel static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,
35498210b7fSArend van Spriel 							 const char *name,
35598210b7fSArend van Spriel 							 struct dentry *parent,
35698210b7fSArend van Spriel 					   int (*read_fn)(struct seq_file *s,
35798210b7fSArend van Spriel 							  void *data))
35898210b7fSArend van Spriel {
35998210b7fSArend van Spriel 	return ERR_PTR(-ENODEV);
36098210b7fSArend van Spriel }
36198210b7fSArend van Spriel 
3620642ef6fSRichard Fitzgerald static inline ssize_t debugfs_read_file_bool(struct file *file,
3630642ef6fSRichard Fitzgerald 					     char __user *user_buf,
3640642ef6fSRichard Fitzgerald 					     size_t count, loff_t *ppos)
3650642ef6fSRichard Fitzgerald {
3660642ef6fSRichard Fitzgerald 	return -ENODEV;
3670642ef6fSRichard Fitzgerald }
3680642ef6fSRichard Fitzgerald 
3690642ef6fSRichard Fitzgerald static inline ssize_t debugfs_write_file_bool(struct file *file,
3700642ef6fSRichard Fitzgerald 					      const char __user *user_buf,
3710642ef6fSRichard Fitzgerald 					      size_t count, loff_t *ppos)
3720642ef6fSRichard Fitzgerald {
3730642ef6fSRichard Fitzgerald 	return -ENODEV;
3740642ef6fSRichard Fitzgerald }
3750642ef6fSRichard Fitzgerald 
3761da177e4SLinus Torvalds #endif
3771da177e4SLinus Torvalds 
3781da177e4SLinus Torvalds #endif
379