Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions drivers/usb/typec/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,19 @@ static int typec_probe(struct device *dev)
}

ret = drv->probe(adev);
if (ret)
if (ret) {
typec_altmode_remove_links(altmode);
return ret;
}

/*
* A mode entered before its driver bound took no reference on the
* driver's module, but leaving it drops one. Take it now.
*/
if (adev->active && !is_typec_port(adev->dev.parent))
WARN_ON(!try_module_get(drv->driver.owner));

return ret;
return 0;
}

static void typec_remove(struct device *dev)
Expand Down
Loading