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