lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200227104547.30085-1-m.felsch@pengutronix.de>
Date:   Thu, 27 Feb 2020 11:45:47 +0100
From:   Marco Felsch <m.felsch@...gutronix.de>
To:     gregkh@...uxfoundation.org, rafael@...nel.org,
        rmk+kernel@....linux.org.uk, linux@...linux.org.uk
Cc:     linux-kernel@...r.kernel.org, kernel@...gutronix.de,
        Philipp Zabel <p.zabel@...gutronix.de>
Subject: [PATCH] component: allow missing unbind callback

The component framework reuses the devres managed functions. There is no
need to specify an unbind() callback if the driver only wants to release
the devres managed resources. The bind/unbind is like the probe/remove
pair. The bind/probe is necessary and the unbind/remove is optional.

Signed-off-by: Marco Felsch <m.felsch@...gutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@...gutronix.de>
---
 drivers/base/component.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/component.c b/drivers/base/component.c
index c7879f5ae2fb..e97704104784 100644
--- a/drivers/base/component.c
+++ b/drivers/base/component.c
@@ -528,7 +528,8 @@ static void component_unbind(struct component *component,
 {
 	WARN_ON(!component->bound);
 
-	component->ops->unbind(component->dev, master->dev, data);
+	if (component->ops && component->ops->unbind)
+		component->ops->unbind(component->dev, master->dev, data);
 	component->bound = false;
 
 	/* Release all resources claimed in the binding of this component */
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ