xref: /linux-6.15/include/linux/debugfs.h (revision a2b992c8)
13bce94fdSGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
21da177e4SLinus Torvalds /*
31da177e4SLinus Torvalds  *  debugfs.h - a tiny little debug file system
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  *  Copyright (C) 2004 Greg Kroah-Hartman <[email protected]>
61da177e4SLinus Torvalds  *  Copyright (C) 2004 IBM Inc.
71da177e4SLinus Torvalds  *
81da177e4SLinus Torvalds  *  debugfs is for people to use instead of /proc or /sys.
9e1b4fc7aSMauro Carvalho Chehab  *  See Documentation/filesystems/ for more details.
101da177e4SLinus Torvalds  */
111da177e4SLinus Torvalds 
121da177e4SLinus Torvalds #ifndef _DEBUGFS_H_
131da177e4SLinus Torvalds #define _DEBUGFS_H_
141da177e4SLinus Torvalds 
151da177e4SLinus Torvalds #include <linux/fs.h>
161a087c6aSAlessandro Rubini #include <linux/seq_file.h>
171da177e4SLinus Torvalds 
18a7a76cefSRoland Dreier #include <linux/types.h>
1949d200deSNicolai Stange #include <linux/compiler.h>
20a7a76cefSRoland Dreier 
21f30d0a81SArend van Spriel struct device;
22a7a76cefSRoland Dreier struct file_operations;
23a7a76cefSRoland Dreier 
24dd308bc3SMichael Ellerman struct debugfs_blob_wrapper {
25dd308bc3SMichael Ellerman 	void *data;
26dd308bc3SMichael Ellerman 	unsigned long size;
27dd308bc3SMichael Ellerman };
28dd308bc3SMichael Ellerman 
291a087c6aSAlessandro Rubini struct debugfs_reg32 {
301a087c6aSAlessandro Rubini 	char *name;
311a087c6aSAlessandro Rubini 	unsigned long offset;
321a087c6aSAlessandro Rubini };
331a087c6aSAlessandro Rubini 
341a087c6aSAlessandro Rubini struct debugfs_regset32 {
35833d6e01SFelipe Balbi 	const struct debugfs_reg32 *regs;
361a087c6aSAlessandro Rubini 	int nregs;
371a087c6aSAlessandro Rubini 	void __iomem *base;
3830332eeeSGeert Uytterhoeven 	struct device *dev;	/* Optional device for Runtime PM */
391a087c6aSAlessandro Rubini };
401a087c6aSAlessandro Rubini 
41*a2b992c8SJakub Kicinski struct debugfs_u32_array {
42*a2b992c8SJakub Kicinski 	u32 *array;
43*a2b992c8SJakub Kicinski 	u32 n_elements;
44*a2b992c8SJakub Kicinski };
45*a2b992c8SJakub Kicinski 
46ae79cdaaS[email protected] extern struct dentry *arch_debugfs_dir;
47ae79cdaaS[email protected] 
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 
634250b047SKusanagi Kouichi typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *);
644250b047SKusanagi Kouichi 
651da177e4SLinus Torvalds #if defined(CONFIG_DEBUG_FS)
663634634eSHarvey Harrison 
67a7c5437bSOmar Sandoval struct dentry *debugfs_lookup(const char *name, struct dentry *parent);
68a7c5437bSOmar Sandoval 
69f4ae40a6SAl Viro struct dentry *debugfs_create_file(const char *name, umode_t mode,
701da177e4SLinus Torvalds 				   struct dentry *parent, void *data,
7199ac48f5SArjan van de Ven 				   const struct file_operations *fops);
72c6468808SNicolai Stange struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode,
73c6468808SNicolai Stange 				   struct dentry *parent, void *data,
74c6468808SNicolai Stange 				   const struct file_operations *fops);
751da177e4SLinus Torvalds 
76526ee72dSGreg Kroah-Hartman void debugfs_create_file_size(const char *name, umode_t mode,
77e59b4e91SDavid Howells 			      struct dentry *parent, void *data,
78e59b4e91SDavid Howells 			      const struct file_operations *fops,
79e59b4e91SDavid Howells 			      loff_t file_size);
80e59b4e91SDavid Howells 
811da177e4SLinus Torvalds struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
821da177e4SLinus Torvalds 
8366f54963SPeter Oberparleiter struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
8466f54963SPeter Oberparleiter 				      const char *dest);
8566f54963SPeter Oberparleiter 
8677b3da6eSAl Viro struct dentry *debugfs_create_automount(const char *name,
8777b3da6eSAl Viro 					struct dentry *parent,
8893faccbbSEric W. Biederman 					debugfs_automount_t f,
8977b3da6eSAl Viro 					void *data);
9077b3da6eSAl Viro 
911da177e4SLinus Torvalds void debugfs_remove(struct dentry *dentry);
92a3d1e7ebSAl Viro #define debugfs_remove_recursive debugfs_remove
931da177e4SLinus Torvalds 
94055ab8e3SNicolai Stange const struct file_operations *debugfs_real_fops(const struct file *filp);
957c8d4698SNicolai Stange 
96e9117a5aSNicolai Stange int debugfs_file_get(struct dentry *dentry);
97e9117a5aSNicolai Stange void debugfs_file_put(struct dentry *dentry);
98e9117a5aSNicolai Stange 
99c6468808SNicolai Stange ssize_t debugfs_attr_read(struct file *file, char __user *buf,
100c6468808SNicolai Stange 			size_t len, loff_t *ppos);
101c6468808SNicolai Stange ssize_t debugfs_attr_write(struct file *file, const char __user *buf,
102c6468808SNicolai Stange 			size_t len, loff_t *ppos);
103c6468808SNicolai Stange 
104cfc94cdfSJan Kara struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
105cfc94cdfSJan Kara                 struct dentry *new_dir, const char *new_name);
106cfc94cdfSJan Kara 
1079655ac4aSGreg Kroah-Hartman void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent,
1089655ac4aSGreg Kroah-Hartman 		       u8 *value);
109313f5dbbSGreg Kroah-Hartman void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
110313f5dbbSGreg Kroah-Hartman 			u16 *value);
1112b07021aSGreg Kroah-Hartman void debugfs_create_u32(const char *name, umode_t mode, struct dentry *parent,
1122b07021aSGreg Kroah-Hartman 			u32 *value);
113ad26221fSGreg Kroah-Hartman void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
114ad26221fSGreg Kroah-Hartman 			u64 *value);
115c23fe831SViresh Kumar struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
116c23fe831SViresh Kumar 				    struct dentry *parent, unsigned long *value);
117c7c11689SGreg Kroah-Hartman void debugfs_create_x8(const char *name, umode_t mode, struct dentry *parent,
118c7c11689SGreg Kroah-Hartman 		       u8 *value);
119e40d38f2SGreg Kroah-Hartman void debugfs_create_x16(const char *name, umode_t mode, struct dentry *parent,
120e40d38f2SGreg Kroah-Hartman 			u16 *value);
121f5cb0a7eSGreg Kroah-Hartman void debugfs_create_x32(const char *name, umode_t mode, struct dentry *parent,
122f5cb0a7eSGreg Kroah-Hartman 			u32 *value);
1230864c408SGreg Kroah-Hartman void debugfs_create_x64(const char *name, umode_t mode, struct dentry *parent,
1240864c408SGreg Kroah-Hartman 			u64 *value);
1258e580263SGreg Kroah-Hartman void debugfs_create_size_t(const char *name, umode_t mode,
1265e078787SInaky Perez-Gonzalez 			   struct dentry *parent, size_t *value);
1279927c6faSGreg Kroah-Hartman void debugfs_create_atomic_t(const char *name, umode_t mode,
1283a76e5e0SSeth Jennings 			     struct dentry *parent, atomic_t *value);
129f4ae40a6SAl Viro struct dentry *debugfs_create_bool(const char *name, umode_t mode,
130621a5f7aSViresh Kumar 				  struct dentry *parent, bool *value);
1311da177e4SLinus Torvalds 
132f4ae40a6SAl Viro struct dentry *debugfs_create_blob(const char *name, umode_t mode,
133dd308bc3SMichael Ellerman 				  struct dentry *parent,
134dd308bc3SMichael Ellerman 				  struct debugfs_blob_wrapper *blob);
135c0f92ba9SFrederic Weisbecker 
136ae91c925SGreg Kroah-Hartman void debugfs_create_regset32(const char *name, umode_t mode,
1371a087c6aSAlessandro Rubini 			     struct dentry *parent,
1381a087c6aSAlessandro Rubini 			     struct debugfs_regset32 *regset);
1391a087c6aSAlessandro Rubini 
1409761536eSJoe Perches void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
1411a087c6aSAlessandro Rubini 			  int nregs, void __iomem *base, char *prefix);
1421a087c6aSAlessandro Rubini 
143c9c2c27dSGreg Kroah-Hartman void debugfs_create_u32_array(const char *name, umode_t mode,
144*a2b992c8SJakub Kicinski 			      struct dentry *parent,
145*a2b992c8SJakub Kicinski 			      struct debugfs_u32_array *array);
1469fe2a701SSrivatsa Vaddagiri 
14798210b7fSArend van Spriel struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name,
14898210b7fSArend van Spriel 					   struct dentry *parent,
14998210b7fSArend van Spriel 					   int (*read_fn)(struct seq_file *s,
15098210b7fSArend van Spriel 							  void *data));
15198210b7fSArend van Spriel 
152c0f92ba9SFrederic Weisbecker bool debugfs_initialized(void);
153c0f92ba9SFrederic Weisbecker 
1540642ef6fSRichard Fitzgerald ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf,
1550642ef6fSRichard Fitzgerald 			       size_t count, loff_t *ppos);
1560642ef6fSRichard Fitzgerald 
1570642ef6fSRichard Fitzgerald ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf,
1580642ef6fSRichard Fitzgerald 				size_t count, loff_t *ppos);
1590642ef6fSRichard Fitzgerald 
1601da177e4SLinus Torvalds #else
161a7a76cefSRoland Dreier 
162a7a76cefSRoland Dreier #include <linux/err.h>
163a7a76cefSRoland Dreier 
1641da177e4SLinus Torvalds /*
1651da177e4SLinus Torvalds  * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled
1661da177e4SLinus Torvalds  * so users have a chance to detect if there was a real error or not.  We don't
1671da177e4SLinus Torvalds  * want to duplicate the design decision mistakes of procfs and devfs again.
1681da177e4SLinus Torvalds  */
1691da177e4SLinus Torvalds 
170a7c5437bSOmar Sandoval static inline struct dentry *debugfs_lookup(const char *name,
171a7c5437bSOmar Sandoval 					    struct dentry *parent)
172a7c5437bSOmar Sandoval {
173a7c5437bSOmar Sandoval 	return ERR_PTR(-ENODEV);
174a7c5437bSOmar Sandoval }
175a7c5437bSOmar Sandoval 
176f4ae40a6SAl Viro static inline struct dentry *debugfs_create_file(const char *name, umode_t mode,
177bde11d79SJean Delvare 					struct dentry *parent, void *data,
178bde11d79SJean Delvare 					const struct file_operations *fops)
1791da177e4SLinus Torvalds {
1801da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
1811da177e4SLinus Torvalds }
1821da177e4SLinus Torvalds 
183c2a737ebSViresh Kumar static inline struct dentry *debugfs_create_file_unsafe(const char *name,
184c2a737ebSViresh Kumar 					umode_t mode, struct dentry *parent,
185c2a737ebSViresh Kumar 					void *data,
186c2a737ebSViresh Kumar 					const struct file_operations *fops)
187c2a737ebSViresh Kumar {
188c2a737ebSViresh Kumar 	return ERR_PTR(-ENODEV);
189c2a737ebSViresh Kumar }
190c2a737ebSViresh Kumar 
191526ee72dSGreg Kroah-Hartman static inline void 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)
195526ee72dSGreg Kroah-Hartman { }
196e59b4e91SDavid Howells 
1971da177e4SLinus Torvalds static inline struct dentry *debugfs_create_dir(const char *name,
1981da177e4SLinus Torvalds 						struct dentry *parent)
1991da177e4SLinus Torvalds {
2001da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2011da177e4SLinus Torvalds }
2021da177e4SLinus Torvalds 
20366f54963SPeter Oberparleiter static inline struct dentry *debugfs_create_symlink(const char *name,
20466f54963SPeter Oberparleiter 						    struct dentry *parent,
20566f54963SPeter Oberparleiter 						    const char *dest)
20666f54963SPeter Oberparleiter {
20766f54963SPeter Oberparleiter 	return ERR_PTR(-ENODEV);
20866f54963SPeter Oberparleiter }
20966f54963SPeter Oberparleiter 
21094e1dec7SJiaxing Wang static inline struct dentry *debugfs_create_automount(const char *name,
21194e1dec7SJiaxing Wang 					struct dentry *parent,
2124250b047SKusanagi Kouichi 					debugfs_automount_t f,
21394e1dec7SJiaxing Wang 					void *data)
21494e1dec7SJiaxing Wang {
21594e1dec7SJiaxing Wang 	return ERR_PTR(-ENODEV);
21694e1dec7SJiaxing Wang }
21794e1dec7SJiaxing Wang 
2181da177e4SLinus Torvalds static inline void debugfs_remove(struct dentry *dentry)
2191da177e4SLinus Torvalds { }
2201da177e4SLinus Torvalds 
2219505e637SHaavard Skinnemoen static inline void debugfs_remove_recursive(struct dentry *dentry)
2229505e637SHaavard Skinnemoen { }
2239505e637SHaavard Skinnemoen 
224f50caa9bSArnd Bergmann const struct file_operations *debugfs_real_fops(const struct file *filp);
225f50caa9bSArnd Bergmann 
226e9117a5aSNicolai Stange static inline int debugfs_file_get(struct dentry *dentry)
227e9117a5aSNicolai Stange {
228e9117a5aSNicolai Stange 	return 0;
229e9117a5aSNicolai Stange }
230e9117a5aSNicolai Stange 
231e9117a5aSNicolai Stange static inline void debugfs_file_put(struct dentry *dentry)
232e9117a5aSNicolai Stange { }
233e9117a5aSNicolai Stange 
2347f847dd3SArnd Bergmann static inline ssize_t debugfs_attr_read(struct file *file, char __user *buf,
2357f847dd3SArnd Bergmann 					size_t len, loff_t *ppos)
2367f847dd3SArnd Bergmann {
2377f847dd3SArnd Bergmann 	return -ENODEV;
2387f847dd3SArnd Bergmann }
2397f847dd3SArnd Bergmann 
2407f847dd3SArnd Bergmann static inline ssize_t debugfs_attr_write(struct file *file,
2417f847dd3SArnd Bergmann 					const char __user *buf,
2427f847dd3SArnd Bergmann 					size_t len, loff_t *ppos)
2437f847dd3SArnd Bergmann {
2447f847dd3SArnd Bergmann 	return -ENODEV;
2457f847dd3SArnd Bergmann }
246c6468808SNicolai Stange 
247cfc94cdfSJan Kara static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
248cfc94cdfSJan Kara                 struct dentry *new_dir, char *new_name)
249cfc94cdfSJan Kara {
250cfc94cdfSJan Kara 	return ERR_PTR(-ENODEV);
251cfc94cdfSJan Kara }
252cfc94cdfSJan Kara 
2539655ac4aSGreg Kroah-Hartman static inline void debugfs_create_u8(const char *name, umode_t mode,
2549655ac4aSGreg Kroah-Hartman 				     struct dentry *parent, u8 *value) { }
2551da177e4SLinus Torvalds 
256313f5dbbSGreg Kroah-Hartman static inline void debugfs_create_u16(const char *name, umode_t mode,
257313f5dbbSGreg Kroah-Hartman 				      struct dentry *parent, u16 *value) { }
2581da177e4SLinus Torvalds 
2592b07021aSGreg Kroah-Hartman static inline void debugfs_create_u32(const char *name, umode_t mode,
2602b07021aSGreg Kroah-Hartman 				      struct dentry *parent, u32 *value) { }
2611da177e4SLinus Torvalds 
262ad26221fSGreg Kroah-Hartman static inline void debugfs_create_u64(const char *name, umode_t mode,
263ad26221fSGreg Kroah-Hartman 				      struct dentry *parent, u64 *value) { }
2648447891fSMichael Ellerman 
265c2a737ebSViresh Kumar static inline struct dentry *debugfs_create_ulong(const char *name,
266c2a737ebSViresh Kumar 						umode_t mode,
267c2a737ebSViresh Kumar 						struct dentry *parent,
268c2a737ebSViresh Kumar 						unsigned long *value)
269c2a737ebSViresh Kumar {
270c2a737ebSViresh Kumar 	return ERR_PTR(-ENODEV);
271c2a737ebSViresh Kumar }
272c2a737ebSViresh Kumar 
273c7c11689SGreg Kroah-Hartman static inline void debugfs_create_x8(const char *name, umode_t mode,
274c7c11689SGreg Kroah-Hartman 				     struct dentry *parent, u8 *value) { }
2752ebefc50SRobin Getz 
276e40d38f2SGreg Kroah-Hartman static inline void debugfs_create_x16(const char *name, umode_t mode,
277e40d38f2SGreg Kroah-Hartman 				      struct dentry *parent, u16 *value) { }
2782ebefc50SRobin Getz 
279f5cb0a7eSGreg Kroah-Hartman static inline void debugfs_create_x32(const char *name, umode_t mode,
280f5cb0a7eSGreg Kroah-Hartman 				      struct dentry *parent, u32 *value) { }
2812ebefc50SRobin Getz 
2820864c408SGreg Kroah-Hartman static inline void debugfs_create_x64(const char *name, umode_t mode,
2830864c408SGreg Kroah-Hartman 				      struct dentry *parent, u64 *value) { }
2843159269eSJohannes Berg 
2858e580263SGreg Kroah-Hartman static inline void debugfs_create_size_t(const char *name, umode_t mode,
2868e580263SGreg Kroah-Hartman 					 struct dentry *parent, size_t *value)
2878e580263SGreg Kroah-Hartman { }
2888adb711fSInaky Perez-Gonzalez 
2899927c6faSGreg Kroah-Hartman static inline void debugfs_create_atomic_t(const char *name, umode_t mode,
2909927c6faSGreg Kroah-Hartman 					   struct dentry *parent,
2919927c6faSGreg Kroah-Hartman 					   atomic_t *value)
2929927c6faSGreg Kroah-Hartman { }
2935b880214SWeijie Yang 
294f4ae40a6SAl Viro static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode,
2951da177e4SLinus Torvalds 						 struct dentry *parent,
296621a5f7aSViresh Kumar 						 bool *value)
2971da177e4SLinus Torvalds {
2981da177e4SLinus Torvalds 	return ERR_PTR(-ENODEV);
2991da177e4SLinus Torvalds }
3001da177e4SLinus Torvalds 
301f4ae40a6SAl Viro static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode,
302dd308bc3SMichael Ellerman 				  struct dentry *parent,
303dd308bc3SMichael Ellerman 				  struct debugfs_blob_wrapper *blob)
304dd308bc3SMichael Ellerman {
305dd308bc3SMichael Ellerman 	return ERR_PTR(-ENODEV);
306dd308bc3SMichael Ellerman }
307dd308bc3SMichael Ellerman 
308ae91c925SGreg Kroah-Hartman static inline void debugfs_create_regset32(const char *name, umode_t mode,
309ae91c925SGreg Kroah-Hartman 					   struct dentry *parent,
3101a087c6aSAlessandro Rubini 					   struct debugfs_regset32 *regset)
3111a087c6aSAlessandro Rubini {
3121a087c6aSAlessandro Rubini }
3131a087c6aSAlessandro Rubini 
3149761536eSJoe Perches static inline void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs,
3155b880214SWeijie Yang 			 int nregs, void __iomem *base, char *prefix)
3165b880214SWeijie Yang {
3175b880214SWeijie Yang }
3185b880214SWeijie Yang 
319c0f92ba9SFrederic Weisbecker static inline bool debugfs_initialized(void)
320c0f92ba9SFrederic Weisbecker {
321c0f92ba9SFrederic Weisbecker 	return false;
322c0f92ba9SFrederic Weisbecker }
323c0f92ba9SFrederic Weisbecker 
324c9c2c27dSGreg Kroah-Hartman static inline void debugfs_create_u32_array(const char *name, umode_t mode,
325*a2b992c8SJakub Kicinski 					    struct dentry *parent,
326*a2b992c8SJakub Kicinski 					    struct debugfs_u32_array *array)
3279fe2a701SSrivatsa Vaddagiri {
3289fe2a701SSrivatsa Vaddagiri }
3299fe2a701SSrivatsa Vaddagiri 
33098210b7fSArend van Spriel static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev,
33198210b7fSArend van Spriel 							 const char *name,
33298210b7fSArend van Spriel 							 struct dentry *parent,
33398210b7fSArend van Spriel 					   int (*read_fn)(struct seq_file *s,
33498210b7fSArend van Spriel 							  void *data))
33598210b7fSArend van Spriel {
33698210b7fSArend van Spriel 	return ERR_PTR(-ENODEV);
33798210b7fSArend van Spriel }
33898210b7fSArend van Spriel 
3390642ef6fSRichard Fitzgerald static inline ssize_t debugfs_read_file_bool(struct file *file,
3400642ef6fSRichard Fitzgerald 					     char __user *user_buf,
3410642ef6fSRichard Fitzgerald 					     size_t count, loff_t *ppos)
3420642ef6fSRichard Fitzgerald {
3430642ef6fSRichard Fitzgerald 	return -ENODEV;
3440642ef6fSRichard Fitzgerald }
3450642ef6fSRichard Fitzgerald 
3460642ef6fSRichard Fitzgerald static inline ssize_t debugfs_write_file_bool(struct file *file,
3470642ef6fSRichard Fitzgerald 					      const char __user *user_buf,
3480642ef6fSRichard Fitzgerald 					      size_t count, loff_t *ppos)
3490642ef6fSRichard Fitzgerald {
3500642ef6fSRichard Fitzgerald 	return -ENODEV;
3510642ef6fSRichard Fitzgerald }
3520642ef6fSRichard Fitzgerald 
3531da177e4SLinus Torvalds #endif
3541da177e4SLinus Torvalds 
355d3504757SGeert Uytterhoeven /**
356d3504757SGeert Uytterhoeven  * debugfs_create_xul - create a debugfs file that is used to read and write an
357d3504757SGeert Uytterhoeven  * unsigned long value, formatted in hexadecimal
358d3504757SGeert Uytterhoeven  * @name: a pointer to a string containing the name of the file to create.
359d3504757SGeert Uytterhoeven  * @mode: the permission that the file should have
360d3504757SGeert Uytterhoeven  * @parent: a pointer to the parent dentry for this file.  This should be a
361d3504757SGeert Uytterhoeven  *          directory dentry if set.  If this parameter is %NULL, then the
362d3504757SGeert Uytterhoeven  *          file will be created in the root of the debugfs filesystem.
363d3504757SGeert Uytterhoeven  * @value: a pointer to the variable that the file should read to and write
364d3504757SGeert Uytterhoeven  *         from.
365d3504757SGeert Uytterhoeven  */
366d3504757SGeert Uytterhoeven static inline void debugfs_create_xul(const char *name, umode_t mode,
367d3504757SGeert Uytterhoeven 				      struct dentry *parent,
368d3504757SGeert Uytterhoeven 				      unsigned long *value)
369d3504757SGeert Uytterhoeven {
370d3504757SGeert Uytterhoeven 	if (sizeof(*value) == sizeof(u32))
371d3504757SGeert Uytterhoeven 		debugfs_create_x32(name, mode, parent, (u32 *)value);
372d3504757SGeert Uytterhoeven 	else
373d3504757SGeert Uytterhoeven 		debugfs_create_x64(name, mode, parent, (u64 *)value);
374d3504757SGeert Uytterhoeven }
375d3504757SGeert Uytterhoeven 
3761da177e4SLinus Torvalds #endif
377