]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: cros_ec_dev: Don't advertise junk features on failure
authorStephen Boyd <swboyd@chromium.org>
Thu, 31 May 2018 06:23:43 +0000 (23:23 -0700)
committerLee Jones <lee.jones@linaro.org>
Mon, 4 Jun 2018 07:46:42 +0000 (08:46 +0100)
commitca5be6ede627a2b70f5166b2765e22ca319a9c9f
tree192125f20a87641b62b06a7be33fc7e14115f78f
parent9211d47674284e9837b49ca173c1ed94a80a822c
mfd: cros_ec_dev: Don't advertise junk features on failure

If the feature query fails during this driver's probe, we memset the
features bits to 0, but then we continue to overwrite that with whatever
junk we read back when the feature probing failed. In the case of a SPI
device, it may be complete junk, causing the caller of this function to
think certain features are present when they aren't. Don't copy over the
bad message on failure so we can fail more gracefully.

Fixes: e0ed4e3f6214 ("platform/chrome: Introduce a new function to check EC features.")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Acked-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/cros_ec_dev.c