diff mbox series

[15/20] hda: cs35l41: Remove unnecessary log

Message ID 20220303173059.269657-16-tanureal@opensource.cirrus.com
State New
Headers show
Series Support external boost at CS35l41 ASoC driver | expand

Commit Message

Lucas tanure March 3, 2022, 5:30 p.m. UTC
If regmap fails would fail during probe of the device.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
---
 sound/pci/hda/cs35l41_hda.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

Comments

Lucas tanure March 4, 2022, 3:05 p.m. UTC | #1
On 3/3/22 17:50, Mark Brown wrote:
> On Thu, Mar 03, 2022 at 05:30:54PM +0000, Lucas Tanure wrote:
> 
>> If regmap fails would fail during probe of the device.
> 
> I'm pretty sure circumstances could arise which would break things at
> runtime.
Yes, so instead of not logging that, we can log the last regmap access 
per switch case, instead of all of them.
diff mbox series

Patch

diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c
index 90c833a25599..f21d048e60ab 100644
--- a/sound/pci/hda/cs35l41_hda.c
+++ b/sound/pci/hda/cs35l41_hda.c
@@ -135,37 +135,31 @@  static void cs35l41_hda_playback_hook(struct device *dev, int action)
 	struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev);
 	const struct cs35l41_hda_reg_sequence *reg_seq = cs35l41->reg_seq;
 	struct regmap *reg = cs35l41->regmap;
-	int ret = 0;
 
 	switch (action) {
 	case HDA_GEN_PCM_ACT_OPEN:
-		ret = regmap_multi_reg_write(reg, cs35l41_hda_config,
-					     ARRAY_SIZE(cs35l41_hda_config));
+		regmap_multi_reg_write(reg, cs35l41_hda_config, ARRAY_SIZE(cs35l41_hda_config));
 		regmap_update_bits(reg, CS35L41_PWR_CTRL2,
 				   CS35L41_AMP_EN_MASK, 1 << CS35L41_AMP_EN_SHIFT);
 		break;
 	case HDA_GEN_PCM_ACT_PREPARE:
 		if (reg_seq->prepare)
-			ret = regmap_multi_reg_write(reg, reg_seq->prepare, reg_seq->num_prepare);
+			regmap_multi_reg_write(reg, reg_seq->prepare, reg_seq->num_prepare);
 		break;
 	case HDA_GEN_PCM_ACT_CLEANUP:
 		regmap_multi_reg_write(reg, cs35l41_hda_mute, ARRAY_SIZE(cs35l41_hda_mute));
 		if (reg_seq->cleanup)
-			ret = regmap_multi_reg_write(reg, reg_seq->cleanup, reg_seq->num_cleanup);
+			regmap_multi_reg_write(reg, reg_seq->cleanup, reg_seq->num_cleanup);
 		break;
 	case HDA_GEN_PCM_ACT_CLOSE:
 		regmap_update_bits(reg, CS35L41_PWR_CTRL2,
 				   CS35L41_AMP_EN_MASK, 0 << CS35L41_AMP_EN_SHIFT);
 		if (reg_seq->close)
-			ret = regmap_multi_reg_write(reg, reg_seq->close, reg_seq->num_close);
+			regmap_multi_reg_write(reg, reg_seq->close, reg_seq->num_close);
 		break;
 	default:
-		ret = -EINVAL;
 		break;
 	}
-
-	if (ret)
-		dev_warn(cs35l41->dev, "Failed to apply multi reg write: %d\n", ret);
 }
 
 static int cs35l41_hda_channel_map(struct device *dev, unsigned int tx_num, unsigned int *tx_slot,