summaryrefslogtreecommitdiff
path: root/kernels/linux-libre-pae/tpmdd-devel-v3-base-platform-fix-binding-for-drivers-without-probe-callback.patch
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/linux-libre-pae/tpmdd-devel-v3-base-platform-fix-binding-for-drivers-without-probe-callback.patch')
-rw-r--r--kernels/linux-libre-pae/tpmdd-devel-v3-base-platform-fix-binding-for-drivers-without-probe-callback.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/kernels/linux-libre-pae/tpmdd-devel-v3-base-platform-fix-binding-for-drivers-without-probe-callback.patch b/kernels/linux-libre-pae/tpmdd-devel-v3-base-platform-fix-binding-for-drivers-without-probe-callback.patch
new file mode 100644
index 000000000..691ab79b9
--- /dev/null
+++ b/kernels/linux-libre-pae/tpmdd-devel-v3-base-platform-fix-binding-for-drivers-without-probe-callback.patch
@@ -0,0 +1,24 @@
+diff --git a/drivers/base/platform.c b/drivers/base/platform.c
+index 1dd6d3b..176b59f 100644
+--- a/drivers/base/platform.c
++++ b/drivers/base/platform.c
+@@ -513,10 +513,15 @@ static int platform_drv_probe(struct device *_dev)
+ return ret;
+
+ ret = dev_pm_domain_attach(_dev, true);
+- if (ret != -EPROBE_DEFER && drv->probe) {
+- ret = drv->probe(dev);
+- if (ret)
+- dev_pm_domain_detach(_dev, true);
++ if (ret != -EPROBE_DEFER) {
++ if (drv->probe) {
++ ret = drv->probe(dev);
++ if (ret)
++ dev_pm_domain_detach(_dev, true);
++ } else {
++ /* don't fail if just dev_pm_domain_attach failed */
++ ret = 0;
++ }
+ }
+
+ if (drv->prevent_deferred_probe && ret == -EPROBE_DEFER) {