base: dd: don't remove driver_data in -EPROBE_DEFER case

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@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yi Zhang 2016-03-08 23:15:22 +08:00 committed by Greg Kroah-Hartman
parent e4234a1fc3
commit ded9db380d
1 changed files with 2 additions and 1 deletions

View File

@ -402,6 +402,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
devres_release_all(dev);
driver_sysfs_remove(dev);
dev->driver = NULL;
if (ret != -EPROBE_DEFER)
dev_set_drvdata(dev, NULL);
if (dev->pm_domain && dev->pm_domain->dismiss)
dev->pm_domain->dismiss(dev);