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 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 */ 55e41746b0SJakub Kicinski static inline const struct file_operations *debugfs_real_fops(const struct file *filp) 5686f0e067SChristian Lamparter __must_hold(&debugfs_srcu) 5786f0e067SChristian Lamparter { 5886f0e067SChristian Lamparter /* 5986f0e067SChristian Lamparter * Neither the pointer to the struct file_operations, nor its 6086f0e067SChristian Lamparter * contents ever change -- srcu_dereference() is not needed here. 6186f0e067SChristian Lamparter */ 6286f0e067SChristian Lamparter return filp->f_path.dentry->d_fsdata; 6386f0e067SChristian Lamparter } 6486f0e067SChristian Lamparter 657f847dd3SArnd Bergmann #define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt) \ 667f847dd3SArnd Bergmann static int __fops ## _open(struct inode *inode, struct file *file) \ 677f847dd3SArnd Bergmann { \ 687f847dd3SArnd Bergmann __simple_attr_check_format(__fmt, 0ull); \ 697f847dd3SArnd Bergmann return simple_attr_open(inode, file, __get, __set, __fmt); \ 707f847dd3SArnd Bergmann } \ 717f847dd3SArnd Bergmann static const struct file_operations __fops = { \ 727f847dd3SArnd Bergmann .owner = THIS_MODULE, \ 737f847dd3SArnd Bergmann .open = __fops ## _open, \ 747f847dd3SArnd Bergmann .release = simple_attr_release, \ 757f847dd3SArnd Bergmann .read = debugfs_attr_read, \ 767f847dd3SArnd Bergmann .write = debugfs_attr_write, \ 77895ce6c8SGeliang Tang .llseek = no_llseek, \ 787f847dd3SArnd Bergmann } 797f847dd3SArnd Bergmann 801da177e4SLinus Torvalds #if defined(CONFIG_DEBUG_FS) 813634634eSHarvey Harrison 82a7c5437bSOmar Sandoval struct dentry *debugfs_lookup(const char *name, struct dentry *parent); 83a7c5437bSOmar Sandoval 84f4ae40a6SAl Viro struct dentry *debugfs_create_file(const char *name, umode_t mode, 851da177e4SLinus Torvalds struct dentry *parent, void *data, 8699ac48f5SArjan van de Ven const struct file_operations *fops); 87c6468808SNicolai Stange struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode, 88c6468808SNicolai Stange struct dentry *parent, void *data, 89c6468808SNicolai Stange const struct file_operations *fops); 901da177e4SLinus Torvalds 91e59b4e91SDavid Howells struct dentry *debugfs_create_file_size(const char *name, umode_t mode, 92e59b4e91SDavid Howells struct dentry *parent, void *data, 93e59b4e91SDavid Howells const struct file_operations *fops, 94e59b4e91SDavid Howells loff_t file_size); 95e59b4e91SDavid Howells 961da177e4SLinus Torvalds struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); 971da177e4SLinus Torvalds 9866f54963SPeter Oberparleiter struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, 9966f54963SPeter Oberparleiter const char *dest); 10066f54963SPeter Oberparleiter 10193faccbbSEric W. Biederman typedef struct vfsmount *(*debugfs_automount_t)(struct dentry *, void *); 10277b3da6eSAl Viro struct dentry *debugfs_create_automount(const char *name, 10377b3da6eSAl Viro struct dentry *parent, 10493faccbbSEric W. Biederman debugfs_automount_t f, 10577b3da6eSAl Viro void *data); 10677b3da6eSAl Viro 1071da177e4SLinus Torvalds void debugfs_remove(struct dentry *dentry); 1089505e637SHaavard Skinnemoen void debugfs_remove_recursive(struct dentry *dentry); 1091da177e4SLinus Torvalds 11049d200deSNicolai Stange int debugfs_use_file_start(const struct dentry *dentry, int *srcu_idx) 11149d200deSNicolai Stange __acquires(&debugfs_srcu); 11249d200deSNicolai Stange 11349d200deSNicolai Stange void debugfs_use_file_finish(int srcu_idx) __releases(&debugfs_srcu); 11449d200deSNicolai Stange 115c6468808SNicolai Stange ssize_t debugfs_attr_read(struct file *file, char __user *buf, 116c6468808SNicolai Stange size_t len, loff_t *ppos); 117c6468808SNicolai Stange ssize_t debugfs_attr_write(struct file *file, const char __user *buf, 118c6468808SNicolai Stange size_t len, loff_t *ppos); 119c6468808SNicolai Stange 120cfc94cdfSJan Kara struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, 121cfc94cdfSJan Kara struct dentry *new_dir, const char *new_name); 122cfc94cdfSJan Kara 123f4ae40a6SAl Viro struct dentry *debugfs_create_u8(const char *name, umode_t mode, 1241da177e4SLinus Torvalds struct dentry *parent, u8 *value); 125f4ae40a6SAl Viro struct dentry *debugfs_create_u16(const char *name, umode_t mode, 1261da177e4SLinus Torvalds struct dentry *parent, u16 *value); 127f4ae40a6SAl Viro struct dentry *debugfs_create_u32(const char *name, umode_t mode, 1281da177e4SLinus Torvalds struct dentry *parent, u32 *value); 129f4ae40a6SAl Viro struct dentry *debugfs_create_u64(const char *name, umode_t mode, 1308447891fSMichael Ellerman struct dentry *parent, u64 *value); 131c23fe831SViresh Kumar struct dentry *debugfs_create_ulong(const char *name, umode_t mode, 132c23fe831SViresh Kumar struct dentry *parent, unsigned long *value); 133f4ae40a6SAl Viro struct dentry *debugfs_create_x8(const char *name, umode_t mode, 1342ebefc50SRobin Getz struct dentry *parent, u8 *value); 135f4ae40a6SAl Viro struct dentry *debugfs_create_x16(const char *name, umode_t mode, 1362ebefc50SRobin Getz struct dentry *parent, u16 *value); 137f4ae40a6SAl Viro struct dentry *debugfs_create_x32(const char *name, umode_t mode, 1382ebefc50SRobin Getz struct dentry *parent, u32 *value); 139f4ae40a6SAl Viro struct dentry *debugfs_create_x64(const char *name, umode_t mode, 14015b0beaaSHuang Ying struct dentry *parent, u64 *value); 141f4ae40a6SAl Viro struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 1425e078787SInaky Perez-Gonzalez struct dentry *parent, size_t *value); 1433a76e5e0SSeth Jennings struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, 1443a76e5e0SSeth Jennings struct dentry *parent, atomic_t *value); 145f4ae40a6SAl Viro struct dentry *debugfs_create_bool(const char *name, umode_t mode, 146621a5f7aSViresh Kumar struct dentry *parent, bool *value); 1471da177e4SLinus Torvalds 148f4ae40a6SAl Viro struct dentry *debugfs_create_blob(const char *name, umode_t mode, 149dd308bc3SMichael Ellerman struct dentry *parent, 150dd308bc3SMichael Ellerman struct debugfs_blob_wrapper *blob); 151c0f92ba9SFrederic Weisbecker 15288187398SAl Viro struct dentry *debugfs_create_regset32(const char *name, umode_t mode, 1531a087c6aSAlessandro Rubini struct dentry *parent, 1541a087c6aSAlessandro Rubini struct debugfs_regset32 *regset); 1551a087c6aSAlessandro Rubini 1569761536eSJoe Perches void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, 1571a087c6aSAlessandro Rubini int nregs, void __iomem *base, char *prefix); 1581a087c6aSAlessandro Rubini 1599fe2a701SSrivatsa Vaddagiri struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, 1609fe2a701SSrivatsa Vaddagiri struct dentry *parent, 1619fe2a701SSrivatsa Vaddagiri u32 *array, u32 elements); 1629fe2a701SSrivatsa Vaddagiri 16398210b7fSArend van Spriel struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, 16498210b7fSArend van Spriel struct dentry *parent, 16598210b7fSArend van Spriel int (*read_fn)(struct seq_file *s, 16698210b7fSArend van Spriel void *data)); 16798210b7fSArend van Spriel 168c0f92ba9SFrederic Weisbecker bool debugfs_initialized(void); 169c0f92ba9SFrederic Weisbecker 1700642ef6fSRichard Fitzgerald ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf, 1710642ef6fSRichard Fitzgerald size_t count, loff_t *ppos); 1720642ef6fSRichard Fitzgerald 1730642ef6fSRichard Fitzgerald ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf, 1740642ef6fSRichard Fitzgerald size_t count, loff_t *ppos); 1750642ef6fSRichard Fitzgerald 1761da177e4SLinus Torvalds #else 177a7a76cefSRoland Dreier 178a7a76cefSRoland Dreier #include <linux/err.h> 179a7a76cefSRoland Dreier 1801da177e4SLinus Torvalds /* 1811da177e4SLinus Torvalds * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled 1821da177e4SLinus Torvalds * so users have a chance to detect if there was a real error or not. We don't 1831da177e4SLinus Torvalds * want to duplicate the design decision mistakes of procfs and devfs again. 1841da177e4SLinus Torvalds */ 1851da177e4SLinus Torvalds 186a7c5437bSOmar Sandoval static inline struct dentry *debugfs_lookup(const char *name, 187a7c5437bSOmar Sandoval struct dentry *parent) 188a7c5437bSOmar Sandoval { 189a7c5437bSOmar Sandoval return ERR_PTR(-ENODEV); 190a7c5437bSOmar Sandoval } 191a7c5437bSOmar Sandoval 192f4ae40a6SAl Viro static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, 193bde11d79SJean Delvare struct dentry *parent, void *data, 194bde11d79SJean Delvare const struct file_operations *fops) 1951da177e4SLinus Torvalds { 1961da177e4SLinus Torvalds return ERR_PTR(-ENODEV); 1971da177e4SLinus Torvalds } 1981da177e4SLinus Torvalds 199*c2a737ebSViresh Kumar static inline struct dentry *debugfs_create_file_unsafe(const char *name, 200*c2a737ebSViresh Kumar umode_t mode, struct dentry *parent, 201*c2a737ebSViresh Kumar void *data, 202*c2a737ebSViresh Kumar const struct file_operations *fops) 203*c2a737ebSViresh Kumar { 204*c2a737ebSViresh Kumar return ERR_PTR(-ENODEV); 205*c2a737ebSViresh Kumar } 206*c2a737ebSViresh Kumar 207e59b4e91SDavid Howells static inline struct dentry *debugfs_create_file_size(const char *name, umode_t mode, 208e59b4e91SDavid Howells struct dentry *parent, void *data, 209e59b4e91SDavid Howells const struct file_operations *fops, 210e59b4e91SDavid Howells loff_t file_size) 211e59b4e91SDavid Howells { 212e59b4e91SDavid Howells return ERR_PTR(-ENODEV); 213e59b4e91SDavid Howells } 214e59b4e91SDavid Howells 2151da177e4SLinus Torvalds static inline struct dentry *debugfs_create_dir(const char *name, 2161da177e4SLinus Torvalds struct dentry *parent) 2171da177e4SLinus Torvalds { 2181da177e4SLinus Torvalds return ERR_PTR(-ENODEV); 2191da177e4SLinus Torvalds } 2201da177e4SLinus Torvalds 22166f54963SPeter Oberparleiter static inline struct dentry *debugfs_create_symlink(const char *name, 22266f54963SPeter Oberparleiter struct dentry *parent, 22366f54963SPeter Oberparleiter const char *dest) 22466f54963SPeter Oberparleiter { 22566f54963SPeter Oberparleiter return ERR_PTR(-ENODEV); 22666f54963SPeter Oberparleiter } 22766f54963SPeter Oberparleiter 22894e1dec7SJiaxing Wang static inline struct dentry *debugfs_create_automount(const char *name, 22994e1dec7SJiaxing Wang struct dentry *parent, 23094e1dec7SJiaxing Wang struct vfsmount *(*f)(void *), 23194e1dec7SJiaxing Wang void *data) 23294e1dec7SJiaxing Wang { 23394e1dec7SJiaxing Wang return ERR_PTR(-ENODEV); 23494e1dec7SJiaxing Wang } 23594e1dec7SJiaxing Wang 2361da177e4SLinus Torvalds static inline void debugfs_remove(struct dentry *dentry) 2371da177e4SLinus Torvalds { } 2381da177e4SLinus Torvalds 2399505e637SHaavard Skinnemoen static inline void debugfs_remove_recursive(struct dentry *dentry) 2409505e637SHaavard Skinnemoen { } 2419505e637SHaavard Skinnemoen 24249d200deSNicolai Stange static inline int debugfs_use_file_start(const struct dentry *dentry, 24349d200deSNicolai Stange int *srcu_idx) 24449d200deSNicolai Stange __acquires(&debugfs_srcu) 24549d200deSNicolai Stange { 24649d200deSNicolai Stange return 0; 24749d200deSNicolai Stange } 24849d200deSNicolai Stange 24949d200deSNicolai Stange static inline void debugfs_use_file_finish(int srcu_idx) 25049d200deSNicolai Stange __releases(&debugfs_srcu) 25149d200deSNicolai Stange { } 25249d200deSNicolai Stange 2537f847dd3SArnd Bergmann static inline ssize_t debugfs_attr_read(struct file *file, char __user *buf, 2547f847dd3SArnd Bergmann size_t len, loff_t *ppos) 2557f847dd3SArnd Bergmann { 2567f847dd3SArnd Bergmann return -ENODEV; 2577f847dd3SArnd Bergmann } 2587f847dd3SArnd Bergmann 2597f847dd3SArnd Bergmann static inline ssize_t debugfs_attr_write(struct file *file, 2607f847dd3SArnd Bergmann const char __user *buf, 2617f847dd3SArnd Bergmann size_t len, loff_t *ppos) 2627f847dd3SArnd Bergmann { 2637f847dd3SArnd Bergmann return -ENODEV; 2647f847dd3SArnd Bergmann } 265c6468808SNicolai Stange 266cfc94cdfSJan Kara static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, 267cfc94cdfSJan Kara struct dentry *new_dir, char *new_name) 268cfc94cdfSJan Kara { 269cfc94cdfSJan Kara return ERR_PTR(-ENODEV); 270cfc94cdfSJan Kara } 271cfc94cdfSJan Kara 272f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode, 2731da177e4SLinus Torvalds struct dentry *parent, 2741da177e4SLinus Torvalds u8 *value) 2751da177e4SLinus Torvalds { 2761da177e4SLinus Torvalds return ERR_PTR(-ENODEV); 2771da177e4SLinus Torvalds } 2781da177e4SLinus Torvalds 279f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode, 2801da177e4SLinus Torvalds struct dentry *parent, 2817b558637SMichal Ostrowski u16 *value) 2821da177e4SLinus Torvalds { 2831da177e4SLinus Torvalds return ERR_PTR(-ENODEV); 2841da177e4SLinus Torvalds } 2851da177e4SLinus Torvalds 286f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode, 2871da177e4SLinus Torvalds struct dentry *parent, 2887b558637SMichal Ostrowski u32 *value) 2891da177e4SLinus Torvalds { 2901da177e4SLinus Torvalds return ERR_PTR(-ENODEV); 2911da177e4SLinus Torvalds } 2921da177e4SLinus Torvalds 293f4ae40a6SAl Viro static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode, 2948447891fSMichael Ellerman struct dentry *parent, 2958447891fSMichael Ellerman u64 *value) 2968447891fSMichael Ellerman { 2978447891fSMichael Ellerman return ERR_PTR(-ENODEV); 2988447891fSMichael Ellerman } 2998447891fSMichael Ellerman 300*c2a737ebSViresh Kumar static inline struct dentry *debugfs_create_ulong(const char *name, 301*c2a737ebSViresh Kumar umode_t mode, 302*c2a737ebSViresh Kumar struct dentry *parent, 303*c2a737ebSViresh Kumar unsigned long *value) 304*c2a737ebSViresh Kumar { 305*c2a737ebSViresh Kumar return ERR_PTR(-ENODEV); 306*c2a737ebSViresh Kumar } 307*c2a737ebSViresh Kumar 308f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode, 3092ebefc50SRobin Getz struct dentry *parent, 3102ebefc50SRobin Getz u8 *value) 3112ebefc50SRobin Getz { 3122ebefc50SRobin Getz return ERR_PTR(-ENODEV); 3132ebefc50SRobin Getz } 3142ebefc50SRobin Getz 315f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode, 3162ebefc50SRobin Getz struct dentry *parent, 3172ebefc50SRobin Getz u16 *value) 3182ebefc50SRobin Getz { 3192ebefc50SRobin Getz return ERR_PTR(-ENODEV); 3202ebefc50SRobin Getz } 3212ebefc50SRobin Getz 322f4ae40a6SAl Viro static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode, 3232ebefc50SRobin Getz struct dentry *parent, 3242ebefc50SRobin Getz u32 *value) 3252ebefc50SRobin Getz { 3262ebefc50SRobin Getz return ERR_PTR(-ENODEV); 3272ebefc50SRobin Getz } 3282ebefc50SRobin Getz 3293159269eSJohannes Berg static inline struct dentry *debugfs_create_x64(const char *name, umode_t mode, 3303159269eSJohannes Berg struct dentry *parent, 3313159269eSJohannes Berg u64 *value) 3323159269eSJohannes Berg { 3333159269eSJohannes Berg return ERR_PTR(-ENODEV); 3343159269eSJohannes Berg } 3353159269eSJohannes Berg 336f4ae40a6SAl Viro static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 3378adb711fSInaky Perez-Gonzalez struct dentry *parent, 3388adb711fSInaky Perez-Gonzalez size_t *value) 3398adb711fSInaky Perez-Gonzalez { 3408adb711fSInaky Perez-Gonzalez return ERR_PTR(-ENODEV); 3418adb711fSInaky Perez-Gonzalez } 3428adb711fSInaky Perez-Gonzalez 3435b880214SWeijie Yang static inline struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, 3445b880214SWeijie Yang struct dentry *parent, atomic_t *value) 3455b880214SWeijie Yang { 3465b880214SWeijie Yang return ERR_PTR(-ENODEV); 3475b880214SWeijie Yang } 3485b880214SWeijie Yang 349f4ae40a6SAl Viro static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, 3501da177e4SLinus Torvalds struct dentry *parent, 351621a5f7aSViresh Kumar bool *value) 3521da177e4SLinus Torvalds { 3531da177e4SLinus Torvalds return ERR_PTR(-ENODEV); 3541da177e4SLinus Torvalds } 3551da177e4SLinus Torvalds 356f4ae40a6SAl Viro static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode, 357dd308bc3SMichael Ellerman struct dentry *parent, 358dd308bc3SMichael Ellerman struct debugfs_blob_wrapper *blob) 359dd308bc3SMichael Ellerman { 360dd308bc3SMichael Ellerman return ERR_PTR(-ENODEV); 361dd308bc3SMichael Ellerman } 362dd308bc3SMichael Ellerman 3631a087c6aSAlessandro Rubini static inline struct dentry *debugfs_create_regset32(const char *name, 36488187398SAl Viro umode_t mode, struct dentry *parent, 3651a087c6aSAlessandro Rubini struct debugfs_regset32 *regset) 3661a087c6aSAlessandro Rubini { 3671a087c6aSAlessandro Rubini return ERR_PTR(-ENODEV); 3681a087c6aSAlessandro Rubini } 3691a087c6aSAlessandro Rubini 3709761536eSJoe Perches static inline void debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, 3715b880214SWeijie Yang int nregs, void __iomem *base, char *prefix) 3725b880214SWeijie Yang { 3735b880214SWeijie Yang } 3745b880214SWeijie Yang 375c0f92ba9SFrederic Weisbecker static inline bool debugfs_initialized(void) 376c0f92ba9SFrederic Weisbecker { 377c0f92ba9SFrederic Weisbecker return false; 378c0f92ba9SFrederic Weisbecker } 379c0f92ba9SFrederic Weisbecker 3809fe2a701SSrivatsa Vaddagiri static inline struct dentry *debugfs_create_u32_array(const char *name, umode_t mode, 3819fe2a701SSrivatsa Vaddagiri struct dentry *parent, 3829fe2a701SSrivatsa Vaddagiri u32 *array, u32 elements) 3839fe2a701SSrivatsa Vaddagiri { 3849fe2a701SSrivatsa Vaddagiri return ERR_PTR(-ENODEV); 3859fe2a701SSrivatsa Vaddagiri } 3869fe2a701SSrivatsa Vaddagiri 38798210b7fSArend van Spriel static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev, 38898210b7fSArend van Spriel const char *name, 38998210b7fSArend van Spriel struct dentry *parent, 39098210b7fSArend van Spriel int (*read_fn)(struct seq_file *s, 39198210b7fSArend van Spriel void *data)) 39298210b7fSArend van Spriel { 39398210b7fSArend van Spriel return ERR_PTR(-ENODEV); 39498210b7fSArend van Spriel } 39598210b7fSArend van Spriel 3960642ef6fSRichard Fitzgerald static inline ssize_t debugfs_read_file_bool(struct file *file, 3970642ef6fSRichard Fitzgerald char __user *user_buf, 3980642ef6fSRichard Fitzgerald size_t count, loff_t *ppos) 3990642ef6fSRichard Fitzgerald { 4000642ef6fSRichard Fitzgerald return -ENODEV; 4010642ef6fSRichard Fitzgerald } 4020642ef6fSRichard Fitzgerald 4030642ef6fSRichard Fitzgerald static inline ssize_t debugfs_write_file_bool(struct file *file, 4040642ef6fSRichard Fitzgerald const char __user *user_buf, 4050642ef6fSRichard Fitzgerald size_t count, loff_t *ppos) 4060642ef6fSRichard Fitzgerald { 4070642ef6fSRichard Fitzgerald return -ENODEV; 4080642ef6fSRichard Fitzgerald } 4090642ef6fSRichard Fitzgerald 4101da177e4SLinus Torvalds #endif 4111da177e4SLinus Torvalds 4121da177e4SLinus Torvalds #endif 413