]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/debugfs.h
Merge tag 'irqchip-fixes-4.10' of git://git.infradead.org/users/jcooper/linux into...
[mirror_ubuntu-artful-kernel.git] / include / linux / debugfs.h
index bf1907d96097c474685b8c8f6d52a5e70d86769b..014cc564d1c437f34d1cbe259f087156f1d148c9 100644 (file)
@@ -63,6 +63,21 @@ debugfs_real_fops(const struct file *filp)
        return filp->f_path.dentry->d_fsdata;
 }
 
+#define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt)          \
+static int __fops ## _open(struct inode *inode, struct file *file)     \
+{                                                                      \
+       __simple_attr_check_format(__fmt, 0ull);                        \
+       return simple_attr_open(inode, file, __get, __set, __fmt);      \
+}                                                                      \
+static const struct file_operations __fops = {                         \
+       .owner   = THIS_MODULE,                                         \
+       .open    = __fops ## _open,                                     \
+       .release = simple_attr_release,                                 \
+       .read    = debugfs_attr_read,                                   \
+       .write   = debugfs_attr_write,                                  \
+       .llseek  = generic_file_llseek,                                 \
+}
+
 #if defined(CONFIG_DEBUG_FS)
 
 struct dentry *debugfs_create_file(const char *name, umode_t mode,
@@ -100,21 +115,6 @@ ssize_t debugfs_attr_read(struct file *file, char __user *buf,
 ssize_t debugfs_attr_write(struct file *file, const char __user *buf,
                        size_t len, loff_t *ppos);
 
-#define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt)          \
-static int __fops ## _open(struct inode *inode, struct file *file)     \
-{                                                                      \
-       __simple_attr_check_format(__fmt, 0ull);                        \
-       return simple_attr_open(inode, file, __get, __set, __fmt);      \
-}                                                                      \
-static const struct file_operations __fops = {                         \
-       .owner   = THIS_MODULE,                                 \
-       .open    = __fops ## _open,                                     \
-       .release = simple_attr_release,                         \
-       .read    = debugfs_attr_read,                                   \
-       .write   = debugfs_attr_write,                                  \
-       .llseek  = generic_file_llseek,                         \
-}
-
 struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
                 struct dentry *new_dir, const char *new_name);
 
@@ -234,8 +234,18 @@ static inline void debugfs_use_file_finish(int srcu_idx)
        __releases(&debugfs_srcu)
 { }
 
-#define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt)  \
-       static const struct file_operations __fops = { 0 }
+static inline ssize_t debugfs_attr_read(struct file *file, char __user *buf,
+                                       size_t len, loff_t *ppos)
+{
+       return -ENODEV;
+}
+
+static inline ssize_t debugfs_attr_write(struct file *file,
+                                       const char __user *buf,
+                                       size_t len, loff_t *ppos)
+{
+       return -ENODEV;
+}
 
 static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
                 struct dentry *new_dir, char *new_name)