[PATCH] base: dd: don't remove driver_data in -EPROBE_DEFER case
From: Yi Zhang
Date: Tue Mar 08 2016 - 10:16:18 EST
the driver_data may be used for sanity check, it fails the
probe() if driver_data is NULL after it is re-triggered.
for example, soc_probe() in sound/soc/soc-core.c
Signed-off-by: Yi Zhang <yizhang_hust@xxxxxxx>
---
drivers/base/dd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index c4da2df..30c53d3 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -402,7 +402,8 @@ pinctrl_bind_failed:
devres_release_all(dev);
driver_sysfs_remove(dev);
dev->driver = NULL;
- dev_set_drvdata(dev, NULL);
+ if (ret != -EPROBE_DEFER)
+ dev_set_drvdata(dev, NULL);
if (dev->pm_domain && dev->pm_domain->dismiss)
dev->pm_domain->dismiss(dev);
pm_runtime_reinit(dev);
--
1.9.1