-
- From 3aed64c3b7925dbc03714226089b9f25b927edc9 Mon Sep 17 00:00:00 2001
- From: Corentin Labbe <clabbe.montjoie@gmail.com>
- Date: Mon, 7 Nov 2016 08:45:28 +0100
- Subject: [PATCH] device core: Try to remove only driver with a remove function
-
- Some driver like pinctrl are builtin_platform_driver and so cannot be
- removed.
-
- This patch modify the way CONFIG_DEBUG_TEST_DRIVER_REMOVE by trying to
- remove only if a remove function is present.
-
- Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
- ---
- drivers/base/dd.c | 3 +++
- 1 file changed, 3 insertions(+)
-
- diff --git a/drivers/base/dd.c b/drivers/base/dd.c
- index d22a726..62b6faf 100644
- --- a/drivers/base/dd.c
- +++ b/drivers/base/dd.c
- @@ -387,6 +387,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
- dev->bus->remove(dev);
- else if (drv->remove)
- drv->remove(dev);
- + else
- + goto skip_test_remove;
-
- devres_release_all(dev);
- driver_sysfs_remove(dev);
- @@ -397,6 +399,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
- pm_runtime_reinit(dev);
-
- goto re_probe;
- +skip_test_remove:
- }
-
- pinctrl_init_done(dev);
- --
- 2.7.3
-