When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this.
Unified · Split
| @@ -321,18 +321,9 @@ static const struct file_operations aat2870_reg_fops = { · 320 unmodified lines | ||
| 321 | 321 | static void aat2870_init_debugfs(struct aat2870_data *aat2870) |
| 322 | 322 | { |
| 323 | 323 | aat2870->dentry_root = debugfs_create_dir("aat2870", NULL); |
| 324 | − if (!aat2870->dentry_root) { | |
| 325 | − dev_warn(aat2870->dev, | |
| 326 | − "Failed to create debugfs root directory\n"); | |
| 327 | − return; | |
| 328 | − } | |
| 329 | 324 | |
| 330 | − aat2870->dentry_reg = debugfs_create_file("regs", 0644, | |
| 331 | − aat2870->dentry_root, | |
| 332 | − aat2870, &aat2870_reg_fops); | |
| 333 | − if (!aat2870->dentry_reg) | |
| 334 | − dev_warn(aat2870->dev, | |
| 335 | − "Failed to create debugfs register file\n"); | |
| 325 | + debugfs_create_file("regs", 0644, aat2870->dentry_root, aat2870, | |
| 326 | + &aat2870_reg_fops); | |
| 336 | 327 | } |
| 337 | 328 | |
| 338 | 329 | #else |
| @@ -136,7 +136,6 @@ struct aat2870_data { · 135 unmodified lines | ||
| 136 | 136 | |
| 137 | 137 | /* for debugfs */ |
| 138 | 138 | struct dentry *dentry_root; |
| 139 | − struct dentry *dentry_reg; | |
| 140 | 139 | }; |
| 141 | 140 | |
| 142 | 141 | struct aat2870_subdev_info { |