diff options
author | 2020-02-27 11:45:47 +0100 | |
---|---|---|
committer | 2020-03-18 14:13:33 +0100 | |
commit | 14422f14da818a3f12344dceee47b4206870a24d (patch) | |
tree | dbed27d4dd7b0a2d73dc3639fb56389c5e45c079 /drivers/base/component.c | |
parent | debugfs: remove return value of debugfs_create_file_size() (diff) | |
download | linux-14422f14da818a3f12344dceee47b4206870a24d.tar.gz linux-14422f14da818a3f12344dceee47b4206870a24d.tar.bz2 linux-14422f14da818a3f12344dceee47b4206870a24d.zip |
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>
Diffstat (limited to 'drivers/base/component.c')
-rw-r--r-- | drivers/base/component.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 */ |