platform/chrome: cros_ec_typec: Check for device within remove function
authorPrashant Malani <pmalani@chromium.org>
Fri, 19 Mar 2021 01:51:03 +0000 (18:51 -0700)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Tue, 30 Mar 2021 16:25:22 +0000 (18:25 +0200)
commit639ff208cb37c5a3f0198e62d04962b677d25c9c
tree5a1f059a6d047635e343e8856ef518a2f597a74d
parentdbc334fb411f2e87ca0e812dc7ba13464aa89504
platform/chrome: cros_ec_typec: Check for device within remove function

In a couple of call sites, we use the same pattern of checking for a
partner or cable device before attempting to remove it. Simplify this by
moving those checks into the remove functions.

Cc: Benson Leung <bleung@chromium.org>
Signed-off-by: Prashant Malani <pmalani@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Link: https://lore.kernel.org/r/20210319015103.3751672-1-pmalani@chromium.org
drivers/platform/chrome/cros_ec_typec.c