Skip to content

Commit c5f0627

Browse files
robherringgregkh
authored andcommitted
driver core: skip removal test for non-removable drivers
Some drivers do not support removal/unbinding. These drivers should have drv->suppress_bind_attrs set to true, so use that to skip the removal test. This doesn't fix anything reported so far, but should prevent some other cases. Some drivers will need fixes to set suppress_bind_attrs to avoid this test. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=177021 Fixes: bea5b15 ("driver core: add test of driver remove calls during probe") Reported-by: Laszlo Ersek <[email protected]> Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a909d3e commit c5f0627

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/base/dd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
324324
{
325325
int ret = -EPROBE_DEFER;
326326
int local_trigger_count = atomic_read(&deferred_trigger_count);
327-
bool test_remove = IS_ENABLED(CONFIG_DEBUG_TEST_DRIVER_REMOVE);
327+
bool test_remove = IS_ENABLED(CONFIG_DEBUG_TEST_DRIVER_REMOVE) &&
328+
!drv->suppress_bind_attrs;
328329

329330
if (defer_all_probes) {
330331
/*

0 commit comments

Comments
 (0)