drivers: base: component: Add debug message for unbind
authorLucas De Marchi <lucas.demarchi@intel.com>
Sat, 22 Feb 2025 00:10:43 +0000 (16:10 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 25 Feb 2025 22:29:05 +0000 (14:29 -0800)
Like when binding component, add a debug message to the unbinding case
to make it easy to track the lifecycle. This also includes the component
pointer since that is used to open a group in devres, making it easier
to track the resources.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250222001051.3012936-4-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/base/component.c

index 7414973..5d10600 100644 (file)
@@ -574,6 +574,9 @@ static void component_unbind(struct component *component,
 {
        WARN_ON(!component->bound);
 
+       dev_dbg(adev->parent, "unbinding %s component %p (ops %ps)\n",
+               dev_name(component->dev), component, component->ops);
+
        if (component->ops && component->ops->unbind)
                component->ops->unbind(component->dev, adev->parent, data);
        component->bound = false;