mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 08:17:46 +00:00
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@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.kernel.org/r/20200227104547.30085-1-m.felsch@pengutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
526ee72dfd
commit
14422f14da
1 changed files with 2 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue