Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

debugfs: remove return value of debugfs_create_devm_seqfile()

No one checks the return value of debugfs_create_devm_seqfile(), as it's
not needed, so make the return value void, so that no one tries to do so
in the future.

Link: https://lore.kernel.org/r/20201023131037.2500765-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+16 -19
+1 -1
Documentation/filesystems/debugfs.rst
··· 199 199 200 200 There is a helper function to create device related seq_file:: 201 201 202 - struct dentry *debugfs_create_devm_seqfile(struct device *dev, 202 + void debugfs_create_devm_seqfile(struct device *dev, 203 203 const char *name, 204 204 struct dentry *parent, 205 205 int (*read_fn)(struct seq_file *s,
+7 -8
fs/debugfs/file.c
··· 1127 1127 * file will be created in the root of the debugfs filesystem. 1128 1128 * @read_fn: function pointer called to print the seq_file content. 1129 1129 */ 1130 - struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, 1131 - struct dentry *parent, 1132 - int (*read_fn)(struct seq_file *s, 1133 - void *data)) 1130 + void debugfs_create_devm_seqfile(struct device *dev, const char *name, 1131 + struct dentry *parent, 1132 + int (*read_fn)(struct seq_file *s, void *data)) 1134 1133 { 1135 1134 struct debugfs_devm_entry *entry; 1136 1135 1137 1136 if (IS_ERR(parent)) 1138 - return ERR_PTR(-ENOENT); 1137 + return; 1139 1138 1140 1139 entry = devm_kzalloc(dev, sizeof(*entry), GFP_KERNEL); 1141 1140 if (!entry) 1142 - return ERR_PTR(-ENOMEM); 1141 + return; 1143 1142 1144 1143 entry->read = read_fn; 1145 1144 entry->dev = dev; 1146 1145 1147 - return debugfs_create_file(name, S_IRUGO, parent, entry, 1148 - &debugfs_devm_entry_ops); 1146 + debugfs_create_file(name, S_IRUGO, parent, entry, 1147 + &debugfs_devm_entry_ops); 1149 1148 } 1150 1149 EXPORT_SYMBOL_GPL(debugfs_create_devm_seqfile);
+8 -10
include/linux/debugfs.h
··· 144 144 struct dentry *parent, 145 145 struct debugfs_u32_array *array); 146 146 147 - struct dentry *debugfs_create_devm_seqfile(struct device *dev, const char *name, 148 - struct dentry *parent, 149 - int (*read_fn)(struct seq_file *s, 150 - void *data)); 147 + void debugfs_create_devm_seqfile(struct device *dev, const char *name, 148 + struct dentry *parent, 149 + int (*read_fn)(struct seq_file *s, void *data)); 151 150 152 151 bool debugfs_initialized(void); 153 152 ··· 326 327 { 327 328 } 328 329 329 - static inline struct dentry *debugfs_create_devm_seqfile(struct device *dev, 330 - const char *name, 331 - struct dentry *parent, 332 - int (*read_fn)(struct seq_file *s, 333 - void *data)) 330 + static inline void debugfs_create_devm_seqfile(struct device *dev, 331 + const char *name, 332 + struct dentry *parent, 333 + int (*read_fn)(struct seq_file *s, 334 + void *data)) 334 335 { 335 - return ERR_PTR(-ENODEV); 336 336 } 337 337 338 338 static inline ssize_t debugfs_read_file_bool(struct file *file,