Re: [PATCH] usb: typec: ucsi: unregister debugfs entries on teardown

From: Dmitry Baryshkov

Date: Thu Jun 11 2026 - 18:52:58 EST


On Thu, Jun 11, 2026 at 10:22:02PM +0000, Bjorn Andersson wrote:
> ucsi_register() creates per-instance debugfs entries, but
> ucsi_unregister() keeps them around until ucsi_destroy().
>
> Drivers like ucsi_glink that unregister/register the same UCSI
> instance across remoteproc restart then try to create an already
> existing debugfs directory and log:
>
> debugfs: 'pmic_glink.ucsi.0' already exists in 'ucsi'
>
> Unregister debugfs entries as part of ucsi_unregister(), and
> clear ucsi->debugfs after freeing it so repeated unregister
> paths remain safe.
>
> Assisted-by: Codex:GPT-5.5
> Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxxxx>

Missing Fixes tag.

> ---
> drivers/usb/typec/ucsi/debugfs.c | 1 +
> drivers/usb/typec/ucsi/ucsi.c | 2 ++
> 2 files changed, 3 insertions(+)
>
--
With best wishes
Dmitry