Re: [PATCH 3/6] thunderbolt: Add sideband register access to debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux