Re: [RFC 02/11] drivers: Add HTE subsystem
From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-07-05 07:30:34
Also in:
linux-devicetree, linux-gpio, linux-tegra, lkml
From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-07-05 07:30:34
Also in:
linux-devicetree, linux-gpio, linux-tegra, lkml
On Fri, Jun 25, 2021 at 04:55:23PM -0700, Dipen Patel wrote:
+static void hte_chip_dbgfs_init(struct hte_device *gdev)
+{
+ const struct hte_chip *chip = gdev->chip;
+ const char *name = chip->name ? chip->name : dev_name(chip->dev);
+
+ gdev->dbg_root = debugfs_create_dir(name, hte_root);
+ if (!gdev->dbg_root)
+ return;No need to check for this, if it fails, your other debugfs calls will handle it just fine.
+
+ debugfs_create_atomic_t("ts_requested", 0444, gdev->dbg_root,
+ &gdev->ts_req);
+ debugfs_create_u32("total_ts", 0444, gdev->dbg_root,
+ &gdev->nlines);
+}
+
+static void hte_ts_dbgfs_init(const char *name, struct hte_ts_info *ei)
+{
+ if (!ei->gdev->dbg_root || !name)
+ return;
+
+ ei->ts_dbg_root = debugfs_create_dir(name, ei->gdev->dbg_root);
+ if (!ei->ts_dbg_root)
+ return;Again, no need to check.
+
+ debugfs_create_size_t("ts_buffer_depth", 0444, ei->ts_dbg_root,
+ &ei->buf->datum_len);
+ debugfs_create_size_t("ts_buffer_watermark", 0444, ei->ts_dbg_root,
+ &ei->buf->watermark);
+ debugfs_create_atomic_t("dropped_timestamps", 0444, ei->ts_dbg_root,
+ &ei->dropped_ts);
+}
+
+static inline void hte_dbgfs_deinit(struct dentry *root)
+{
+ if (!root)
+ return;No need to check this.
+ + debugfs_remove_recursive(root);
Do not wrap a single call with another call :) thanks, greg k-h