spacepaste

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