OSDN Git Service

regulator: core: Don't try to remove device links if add failed
authorSaravana Kannan <saravanak@google.com>
Fri, 15 Nov 2019 00:04:38 +0000 (16:04 -0800)
committerMark Brown <broonie@kernel.org>
Fri, 15 Nov 2019 12:04:20 +0000 (12:04 +0000)
commitb59b654478093fa429ad4c7897ae29f201146a00
tree22ddcac704f51369284ac40c2b6b5a4e09033b62
parent26c2c997aa1a6c5522f6619910ba025e53e69763
regulator: core: Don't try to remove device links if add failed

device_link_add() might not always succeed depending on the type of
device link and the rest of the dependencies in the system. If
device_link_add() didn't succeed, then we shouldn't try to remove the
link later on as it might remove a link someone else created.

Signed-off-by: Saravana Kannan <saravanak@google.com>
Link: https://lore.kernel.org/r/20191115000438.45970-1-saravanak@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c
drivers/regulator/internal.h