2022-03-03 18:53:14

by Lucas Tanure

[permalink] [raw]
Subject: [PATCH 15/20] hda: cs35l41: Remove unnecessary log

If regmap fails would fail during probe of the device.

Signed-off-by: Lucas Tanure <[email protected]>
---
sound/pci/hda/cs35l41_hda.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

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,
--
2.35.1


2022-03-03 19:40:47

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 15/20] hda: cs35l41: Remove unnecessary log

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.


Attachments:
(No filename) (206.00 B)
signature.asc (499.00 B)
Download all attachments

2022-03-04 15:08:22

by Lucas Tanure

[permalink] [raw]
Subject: Re: [PATCH 15/20] hda: cs35l41: Remove unnecessary log

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.