xref: /linux-6.15/include/linux/debugfs.h (revision 93faccbb)
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  */
5568f929ffSJakub Kicinski static inline const struct file_operations *
5668f929ffSJakub 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 
667f847dd3SArnd Bergmann #define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt)		\
677f847dd3SArnd Bergmann static int __fops ## _open(struct inode *inode, struct file *file)	\
687f847dd3SArnd Bergmann {									\
697f847dd3SArnd Bergmann 	__simple_attr_check_format(__fmt, 0ull);			\
707f847dd3SArnd Bergmann 	return simple_attr_open(inode, file, __get, __set, __fmt);	\
717f847dd3SArnd Bergmann }									\
727f847dd3SArnd Bergmann static const struct file_operations __fops = {				\
737f847dd3SArnd Bergmann 	.owner	 = THIS_MODULE,						\
747f847dd3SArnd Bergmann 	.open	 = __fops ## _open,					\
757f847dd3SArnd Bergmann 	.release = simple_attr_release,					\
767f847dd3SArnd Bergmann 	.read	 = debugfs_attr_read,					\
777f847dd3SArnd Bergmann 	.write	 = debugfs_attr_write,					\
787f847dd3SArnd Bergmann 	.llseek  = generic_file_llseek,					\
797f847dd3SArnd Bergmann }
807f847dd3SArnd Bergmann 
811da177e4SLinus Torvalds #if defined(CONFIG_DEBUG_FS)
823634634eSHarvey Harrison 
83f4ae40a6SAl Viro struct dentry *debugfs_create_file(const char *name, umode_t mode,
841da177e4SLinus Torvalds 				   struct dentry *parent, void *data,
8599ac48f5SArjan van de Ven 				   const struct file_operations *fops);
86c6468808SNicolai Stange struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode,
87c6468808SNicolai Stange 				   struct dentry *parent, void *data,
88c6468808SNicolai Stange 				   const struct file_operations *fops);
891da177e4SLinus Torvalds 
90e59b4e91SDavid Howells struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
91e59b4e91SDavid Howells 					struct dentry *parent, void *data,
92e59b4e91SDavid Howells 					const struct file_operations *fops,
93e59b4e91SDavid Howells 					loff_t file_size);
94e59b4e91SDavid Howells 
951da177e4SLinus Torvalds struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
961da177e4SLinus Torvalds 
9766f54963SPeter Oberparleiter struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
9866f54963SPeter Oberparleiter 				      const char *dest);
9966f54963SPeter Oberparleiter 
100*93faccbbSEric W. Biederman typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
10177b3da6eSAl Viro struct dentry *debugfs_create_automount(const char *name,
10277b3da6eSAl Viro 					struct dentry *parent,
103*93faccbbSEric W. Biederman 					debugfs_automount_t f,
10477b3da6eSAl Viro 					void *data);
10577b3da6eSAl Viro 
1061da177e4SLinus Torvalds void debugfs_remove(struct dentry *dentry);
1079505e637SHaavard Skinnemoen void debugfs_remove_recursive(struct dentry *dentry);
1081da177e4SLinus Torvalds 
10949d200deSNicolai Stange int debugfs_use_file_start(const struct dentry *dentry, int *srcu_idx)
11049d200deSNicolai Stange 	__acquires(&debugfs_srcu);
11149d200deSNicolai Stange 
11249d200deSNicolai Stange void debugfs_use_file_finish(int srcu_idx) __releases(&debugfs_srcu);
11349d200deSNicolai Stange 
114c6468808SNicolai Stange ssize_t debugfs_attr_read(struct file *file, char __user *buf,
115c6468808SNicolai Stange 			size_t len, loff_t *ppos);
116c6468808SNicolai Stange ssize_t debugfs_attr_write(struct file *file, const char __user *buf,
117c6468808SNicolai Stange 			size_t len, loff_t *ppos);
118c6468808SNicolai Stange 
119cfc94cdfSJan Kara struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
120cfc94cdfSJan Kara                 struct dentry *new_dir, const char *new_name);
121cfc94cdfSJan Kara 
122f4ae40a6SAl Viro struct dentry *debugfs_create_u8(const char *name, umode_t mode,
1231da177e4SLinus Torvalds 				 struct dentry *parent, u8 *value);
124f4ae40a6SAl Viro struct dentry *debugfs_create_u16(const char *name, umode_t mode,
1251da177e4SLinus Torvalds 				  struct dentry *parent, u16 *value);
126f4ae40a6SAl Viro struct dentry *debugfs_create_u32(const char *name, umode_t mode,
1271da177e4SLinus Torvalds 				  struct dentry *parent, u32 *value);
128f4ae40a6SAl Viro struct dentry *debugfs_create_u64(const char *name, umode_t mode,
1298447891fSMichael Ellerman 				  struct dentry *parent, u64 *value);
130c23fe831SViresh Kumar struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
131c23fe831SViresh Kumar 				    struct dentry *parent, unsigned long *value);
132f4ae40a6SAl Viro struct dentry *debugfs_create_x8(const char *name, umode_t mode,
1332ebefc50SRobin Getz 				 struct dentry *parent, u8 *value);
134f4ae40a6SAl Viro struct dentry *debugfs_create_x16(const char *name, umode_t mode,
1352ebefc50SRobin Getz 				  struct dentry *parent, u16 *value);
136f4ae40a6SAl Viro struct dentry *debugfs_create_x32(const char *name, umode_t mode,
1372ebefc50SRobin Getz 				  struct dentry *parent, u32 *value);
138f4ae40a6SAl Viro struct dentry *debugfs_create_x64(const char *name, umode_t mode,
13915b0beaaSHuang Ying 				  struct dentry *parent, u64 *value);
140f4ae40a6SAl Viro struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
1415e078787SInaky Perez-Gonzalez 				     struct dentry *parent, size_t *value);
1423a76e5e0SSeth Jennings struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
1433a76e5e0SSeth Jennings 				     struct dentry *parent, atomic_t *value);
144f4ae40a6SAl Viro struct dentry *debugfs_create_bool(const char *name, umode_t mode,
145621a5f7aSViresh Kumar 				  struct dentry *parent, bool *value);
1461da177e4SLinus Torvalds 
147f4ae40a6SAl Viro struct dentry *debugfs_create_blob(const char *name, umode_t mode,
148dd308bc3SMichael Ellerman 				  struct dentry *parent,
149dd308bc3SMichael Ellerman 				  struct debugfs_blob_wrapper *blob);
150c0f92ba9SFrederic Weisbecker 
15188187398SAl Viro struct dentry *debugfs_create_regset32(const char *name, umode_t mode,
1521a087c6aSAlessandro Rubini 				     struct dentry *parent,
1531a087c6aSAlessandro Rubini 				     struct debugfs_regset32 *regset);
1541a087c6aSAlessandro Rubini 
1559761536eSJoe Perches void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
1561a087c6aSAlessandro Rubini 			  int nregs, void __iomem *base, char *prefix);
1571a087c6aSAlessandro Rubini 
1589fe2a701SSrivatsa Vaddagiri struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
1599fe2a701SSrivatsa Vaddagiri 					struct dentry *parent,
1609fe2a701SSrivatsa Vaddagiri 					u32 *array, u32 elements);
1619fe2a701SSrivatsa Vaddagiri 
16298210b7fSArend van Spriel struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
16398210b7fSArend van Spriel 					   struct dentry *parent,
16498210b7fSArend van Spriel 					   int (*read_fn)(struct seq_file *s,
16598210b7fSArend van Spriel 							  void *data));
16698210b7fSArend van Spriel 
167c0f92ba9SFrederic Weisbecker bool debugfs_initialized(void);
168c0f92ba9SFrederic Weisbecker 
1690642ef6fSRichard Fitzgerald ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf,
1700642ef6fSRichard Fitzgerald 			       size_t count, loff_t *ppos);
1710642ef6fSRichard Fitzgerald 
1720642ef6fSRichard Fitzgerald ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf,
1730642ef6fSRichard Fitzgerald 				size_t count, loff_t *ppos);
1740642ef6fSRichard Fitzgerald 
1751da177e4SLinus Torvalds #else
176a7a76cefSRoland Dreier 
177a7a76cefSRoland Dreier #include <linux/err.h>
178a7a76cefSRoland Dreier 
1791da177e4SLinus Torvalds /*
1801da177e4SLinus Torvalds  * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled
1811da177e4SLinus Torvalds  * so users have a chance to detect if there was a real error or not.  We don't
1821da177e4SLinus Torvalds  * want to duplicate the design decision mistakes of procfs and devfs again.
1831da177e4SLinus Torvalds  */
1841da177e4SLinus Torvalds 
185f4ae40a6SAl Viro static inline struct dentry *debugfs_create_file(const char *name, umode_t mode,
186bde11d79SJean Delvare 					struct dentry *parent, void *data,
187bde11d79SJean Delvare 					const struct file_operations *fops)
1881da177e4SLinus Torvalds {
1891da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
1901da177e4SLinus Torvalds }
1911da177e4SLinus Torvalds 
192e59b4e91SDavid Howells static inline struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
193e59b4e91SDavid Howells 					struct dentry *parent, void *data,
194e59b4e91SDavid Howells 					const struct file_operations *fops,
195e59b4e91SDavid Howells 					loff_t file_size)
196e59b4e91SDavid Howells {
197e59b4e91SDavid Howells 	return ERR_PTR(-ENODEV);
198e59b4e91SDavid Howells }
199e59b4e91SDavid Howells 
2001da177e4SLinus Torvalds static inline struct dentry *debugfs_create_dir(const char *name,
2011da177e4SLinus Torvalds 						struct dentry *parent)
2021da177e4SLinus Torvalds {
2031da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2041da177e4SLinus Torvalds }
2051da177e4SLinus Torvalds 
20666f54963SPeter Oberparleiter static inline struct dentry *debugfs_create_symlink(const char *name,
20766f54963SPeter Oberparleiter 						    struct dentry *parent,
20866f54963SPeter Oberparleiter 						    const char *dest)
20966f54963SPeter Oberparleiter {
21066f54963SPeter Oberparleiter 	return ERR_PTR(-ENODEV);
21166f54963SPeter Oberparleiter }
21266f54963SPeter Oberparleiter 
21394e1dec7SJiaxing Wang static inline struct dentry *debugfs_create_automount(const char *name,
21494e1dec7SJiaxing Wang 					struct dentry *parent,
21594e1dec7SJiaxing Wang 					struct vfsmount *(*f)(void *),
21694e1dec7SJiaxing Wang 					void *data)
21794e1dec7SJiaxing Wang {
21894e1dec7SJiaxing Wang 	return ERR_PTR(-ENODEV);
21994e1dec7SJiaxing Wang }
22094e1dec7SJiaxing Wang 
2211da177e4SLinus Torvalds static inline void debugfs_remove(struct dentry *dentry)
2221da177e4SLinus Torvalds { }
2231da177e4SLinus Torvalds 
2249505e637SHaavard Skinnemoen static inline void debugfs_remove_recursive(struct dentry *dentry)
2259505e637SHaavard Skinnemoen { }
2269505e637SHaavard Skinnemoen 
22749d200deSNicolai Stange static inline int debugfs_use_file_start(const struct dentry *dentry,
22849d200deSNicolai Stange 					int *srcu_idx)
22949d200deSNicolai Stange 	__acquires(&debugfs_srcu)
23049d200deSNicolai Stange {
23149d200deSNicolai Stange 	return 0;
23249d200deSNicolai Stange }
23349d200deSNicolai Stange 
23449d200deSNicolai Stange static inline void debugfs_use_file_finish(int srcu_idx)
23549d200deSNicolai Stange 	__releases(&debugfs_srcu)
23649d200deSNicolai Stange { }
23749d200deSNicolai Stange 
2387f847dd3SArnd Bergmann static inline ssize_t debugfs_attr_read(struct file *file, char __user *buf,
2397f847dd3SArnd Bergmann 					size_t len, loff_t *ppos)
2407f847dd3SArnd Bergmann {
2417f847dd3SArnd Bergmann 	return -ENODEV;
2427f847dd3SArnd Bergmann }
2437f847dd3SArnd Bergmann 
2447f847dd3SArnd Bergmann static inline ssize_t debugfs_attr_write(struct file *file,
2457f847dd3SArnd Bergmann 					const char __user *buf,
2467f847dd3SArnd Bergmann 					size_t len, loff_t *ppos)
2477f847dd3SArnd Bergmann {
2487f847dd3SArnd Bergmann 	return -ENODEV;
2497f847dd3SArnd Bergmann }
250c6468808SNicolai Stange 
251cfc94cdfSJan Kara static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
252cfc94cdfSJan Kara                 struct dentry *new_dir, char *new_name)
253cfc94cdfSJan Kara {
254cfc94cdfSJan Kara 	return ERR_PTR(-ENODEV);
255cfc94cdfSJan Kara }
256cfc94cdfSJan Kara 
257f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode,
2581da177e4SLinus Torvalds 					       struct dentry *parent,
2591da177e4SLinus Torvalds 					       u8 *value)
2601da177e4SLinus Torvalds {
2611da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2621da177e4SLinus Torvalds }
2631da177e4SLinus Torvalds 
264f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode,
2651da177e4SLinus Torvalds 						struct dentry *parent,
2667b558637SMichal Ostrowski 						u16 *value)
2671da177e4SLinus Torvalds {
2681da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2691da177e4SLinus Torvalds }
2701da177e4SLinus Torvalds 
271f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
2721da177e4SLinus Torvalds 						struct dentry *parent,
2737b558637SMichal Ostrowski 						u32 *value)
2741da177e4SLinus Torvalds {
2751da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2761da177e4SLinus Torvalds }
2771da177e4SLinus Torvalds 
278f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode,
2798447891fSMichael Ellerman 						struct dentry *parent,
2808447891fSMichael Ellerman 						u64 *value)
2818447891fSMichael Ellerman {
2828447891fSMichael Ellerman 	return ERR_PTR(-ENODEV);
2838447891fSMichael Ellerman }
2848447891fSMichael Ellerman 
285f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode,
2862ebefc50SRobin Getz 					       struct dentry *parent,
2872ebefc50SRobin Getz 					       u8 *value)
2882ebefc50SRobin Getz {
2892ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
2902ebefc50SRobin Getz }
2912ebefc50SRobin Getz 
292f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode,
2932ebefc50SRobin Getz 						struct dentry *parent,
2942ebefc50SRobin Getz 						u16 *value)
2952ebefc50SRobin Getz {
2962ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
2972ebefc50SRobin Getz }
2982ebefc50SRobin Getz 
299f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode,
3002ebefc50SRobin Getz 						struct dentry *parent,
3012ebefc50SRobin Getz 						u32 *value)
3022ebefc50SRobin Getz {
3032ebefc50SRobin Getz 	return ERR_PTR(-ENODEV);
3042ebefc50SRobin Getz }
3052ebefc50SRobin Getz 
3063159269eSJohannes Berg static inline struct dentry *debugfs_create_x64(const char *name, umode_t mode,
3073159269eSJohannes Berg 						struct dentry *parent,
3083159269eSJohannes Berg 						u64 *value)
3093159269eSJohannes Berg {
3103159269eSJohannes Berg 	return ERR_PTR(-ENODEV);
3113159269eSJohannes Berg }
3123159269eSJohannes Berg 
313f4ae40a6SAl Viro static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
3148adb711fSInaky Perez-Gonzalez 				     struct dentry *parent,
3158adb711fSInaky Perez-Gonzalez 				     size_t *value)
3168adb711fSInaky Perez-Gonzalez {
3178adb711fSInaky Perez-Gonzalez 	return ERR_PTR(-ENODEV);
3188adb711fSInaky Perez-Gonzalez }
3198adb711fSInaky Perez-Gonzalez 
3205b880214SWeijie Yang static inline struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode,
3215b880214SWeijie Yang 				     struct dentry *parent, atomic_t *value)
3225b880214SWeijie Yang {
3235b880214SWeijie Yang 	return ERR_PTR(-ENODEV);
3245b880214SWeijie Yang }
3255b880214SWeijie Yang 
326f4ae40a6SAl Viro static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode,
3271da177e4SLinus Torvalds 						 struct dentry *parent,
328621a5f7aSViresh Kumar 						 bool *value)
3291da177e4SLinus Torvalds {
3301da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
3311da177e4SLinus Torvalds }
3321da177e4SLinus Torvalds 
333f4ae40a6SAl Viro static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode,
334dd308bc3SMichael Ellerman 				  struct dentry *parent,
335dd308bc3SMichael Ellerman 				  struct debugfs_blob_wrapper *blob)
336dd308bc3SMichael Ellerman {
337dd308bc3SMichael Ellerman 	return ERR_PTR(-ENODEV);
338dd308bc3SMichael Ellerman }
339dd308bc3SMichael Ellerman 
3401a087c6aSAlessandro Rubini static inline struct dentry *debugfs_create_regset32(const char *name,
34188187398SAl Viro 				   umode_t mode, struct dentry *parent,
3421a087c6aSAlessandro Rubini 				   struct debugfs_regset32 *regset)
3431a087c6aSAlessandro Rubini {
3441a087c6aSAlessandro Rubini 	return ERR_PTR(-ENODEV);
3451a087c6aSAlessandro Rubini }
3461a087c6aSAlessandro Rubini 
3479761536eSJoe Perches static inline void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
3485b880214SWeijie Yang 			 int nregs, void __iomem *base, char *prefix)
3495b880214SWeijie Yang {
3505b880214SWeijie Yang }
3515b880214SWeijie Yang 
352c0f92ba9SFrederic Weisbecker static inline bool debugfs_initialized(void)
353c0f92ba9SFrederic Weisbecker {
354c0f92ba9SFrederic Weisbecker 	return false;
355c0f92ba9SFrederic Weisbecker }
356c0f92ba9SFrederic Weisbecker 
3579fe2a701SSrivatsa Vaddagiri static inline struct dentry *debugfs_create_u32_array(const char *name, umode_t mode,
3589fe2a701SSrivatsa Vaddagiri 					struct dentry *parent,
3599fe2a701SSrivatsa Vaddagiri 					u32 *array, u32 elements)
3609fe2a701SSrivatsa Vaddagiri {
3619fe2a701SSrivatsa Vaddagiri 	return ERR_PTR(-ENODEV);
3629fe2a701SSrivatsa Vaddagiri }
3639fe2a701SSrivatsa Vaddagiri 
36498210b7fSArend van Spriel static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,
36598210b7fSArend van Spriel 							 const char *name,
36698210b7fSArend van Spriel 							 struct dentry *parent,
36798210b7fSArend van Spriel 					   int (*read_fn)(struct seq_file *s,
36898210b7fSArend van Spriel 							  void *data))
36998210b7fSArend van Spriel {
37098210b7fSArend van Spriel 	return ERR_PTR(-ENODEV);
37198210b7fSArend van Spriel }
37298210b7fSArend van Spriel 
3730642ef6fSRichard Fitzgerald static inline ssize_t debugfs_read_file_bool(struct file *file,
3740642ef6fSRichard Fitzgerald 					     char __user *user_buf,
3750642ef6fSRichard Fitzgerald 					     size_t count, loff_t *ppos)
3760642ef6fSRichard Fitzgerald {
3770642ef6fSRichard Fitzgerald 	return -ENODEV;
3780642ef6fSRichard Fitzgerald }
3790642ef6fSRichard Fitzgerald 
3800642ef6fSRichard Fitzgerald static inline ssize_t debugfs_write_file_bool(struct file *file,
3810642ef6fSRichard Fitzgerald 					      const char __user *user_buf,
3820642ef6fSRichard Fitzgerald 					      size_t count, loff_t *ppos)
3830642ef6fSRichard Fitzgerald {
3840642ef6fSRichard Fitzgerald 	return -ENODEV;
3850642ef6fSRichard Fitzgerald }
3860642ef6fSRichard Fitzgerald 
3871da177e4SLinus Torvalds #endif
3881da177e4SLinus Torvalds 
3891da177e4SLinus Torvalds #endif
390