diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-01-10 10:18:32 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-01-28 19:00:22 +0300 |
commit | 73d4c3135b2aa2308fe058f58ddbf658436aa385 (patch) | |
tree | 3d8d2d4359fccdcc85fe9d0f38aaf20a890f7027 /sound/soc/codecs/cs42l51.h | |
parent | 74cc53cf59b6a36ef50f164693625629614cb732 (diff) | |
download | linux-73d4c3135b2aa2308fe058f58ddbf658436aa385.tar.xz |
ASoC: cs42l51: Improve error handling in cs42l51_remove()
When disabling a regulator fails while the device goes away, there is
little we can do and the machine is probably in enough trouble that any
action we'd want to take fails anyhow.
The return value used to be passed on in cs42l51_i2c_remove() (i.e. the
i2c device remove callback). But the i2c core ignores the error code
(apart from emitting a generic warning) and removes the device anyhow.
So return 0 unconditionally in cs42l51_i2c_remove(), and instead of
returning the error code to the upper layer emit a more helpful warning
message. After that nobody is interested any more in the actual error
code, so let cs42l51_remove() return void.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220110071832.306185-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/cs42l51.h')
-rw-r--r-- | sound/soc/codecs/cs42l51.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs42l51.h b/sound/soc/codecs/cs42l51.h index 9d06cf7f8876..a79343e8a54e 100644 --- a/sound/soc/codecs/cs42l51.h +++ b/sound/soc/codecs/cs42l51.h @@ -13,7 +13,7 @@ struct device; extern const struct regmap_config cs42l51_regmap; int cs42l51_probe(struct device *dev, struct regmap *regmap); -int cs42l51_remove(struct device *dev); +void cs42l51_remove(struct device *dev); int __maybe_unused cs42l51_suspend(struct device *dev); int __maybe_unused cs42l51_resume(struct device *dev); extern const struct of_device_id cs42l51_of_match[]; |