From: Greg KH <gregkh@linuxfoundation.org>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>,
Michael Jamet <michael.jamet@intel.com>,
Lukas Wunner <lukas@wunner.de>,
Andreas Noever <andreas.noever@gmail.com>,
linux-usb@vger.kernel.org
Subject: Re: [PATCH 3/6] thunderbolt: Add sideband register access to debugfs
Date: Mon, 10 Jun 2024 12:32:46 +0200 [thread overview]
Message-ID: <2024061052-overhear-pushcart-b91a@gregkh> (raw)
In-Reply-To: <20240610100627.3521887-4-mika.westerberg@linux.intel.com>
On Mon, Jun 10, 2024 at 01:06:24PM +0300, Mika Westerberg wrote:
> +void tb_retimer_debugfs_init(struct tb_retimer *rt)
> +{
> + rt->debugfs_dir = debugfs_create_dir(dev_name(&rt->dev),
> + tb_debugfs_root);
Why save this in a local variable? Why not just look it up when you
want to remove it?
> + debugfs_create_file("sb_regs", DEBUGFS_MODE, rt->debugfs_dir, rt,
> + &retimer_sb_regs_fops);
> +}
> +
> +/**
> + * tb_retimer_debugfs_remove() - Remove retimer debugfs directory
> + * @rt: Pointer to retimer structure
> + *
> + * Removes the retimer debugfs directory along with its contents.
> + */
> +void tb_retimer_debugfs_remove(struct tb_retimer *rt)
> +{
> + debugfs_remove_recursive(rt->debugfs_dir);
> + rt->debugfs_dir = NULL;
No need to set it to NULL, but again, I don't think you need the
directory dentry at all.
thanks,
greg k-h
next prev parent reply other threads:[~2024-06-10 10:32 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 10:06 [PATCH 0/6] thunderbolt: Sideband access and retimer lane margining support Mika Westerberg
2024-06-10 10:06 ` [PATCH 1/6] thunderbolt: Move usb4_port_margining_caps() declaration into correct place Mika Westerberg
2024-06-10 10:06 ` [PATCH 2/6] thunderbolt: Make usb4_port_sb_read/write() available outside of usb4.c Mika Westerberg
2024-06-10 10:06 ` [PATCH 3/6] thunderbolt: Add sideband register access to debugfs Mika Westerberg
2024-06-10 10:32 ` Greg KH [this message]
2024-06-10 11:14 ` Mika Westerberg
2024-06-10 10:06 ` [PATCH 4/6] thunderbolt: Split out margining from USB4 port Mika Westerberg
2024-06-10 10:06 ` [PATCH 5/6] thunderbolt: Make margining functions accept target and retimer index Mika Westerberg
2024-06-10 10:06 ` [PATCH 6/6] thunderbolt: Add receiver lane margining support for retimers Mika Westerberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2024061052-overhear-pushcart-b91a@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=michael.jamet@intel.com \
--cc=mika.westerberg@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.