treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / gpu / drm / i915 / gt / debugfs_gt.c
blob75255aaacaed4e7b0ccc3ddab8f695ee505c87e2
1 // SPDX-License-Identifier: MIT
3 /*
4 * Copyright © 2019 Intel Corporation
5 */
7 #include <linux/debugfs.h>
9 #include "debugfs_engines.h"
10 #include "debugfs_gt.h"
11 #include "debugfs_gt_pm.h"
12 #include "i915_drv.h"
14 void debugfs_gt_register(struct intel_gt *gt)
16 struct dentry *root;
18 if (!gt->i915->drm.primary->debugfs_root)
19 return;
21 root = debugfs_create_dir("gt", gt->i915->drm.primary->debugfs_root);
22 if (IS_ERR(root))
23 return;
25 debugfs_engines_register(gt, root);
26 debugfs_gt_pm_register(gt, root);
29 void debugfs_gt_register_files(struct intel_gt *gt,
30 struct dentry *root,
31 const struct debugfs_gt_file *files,
32 unsigned long count)
34 while (count--) {
35 if (!files->eval || files->eval(gt))
36 debugfs_create_file(files->name,
37 0444, root, gt,
38 files->fops);
40 files++;