Skip to content

Commit

Permalink
ASoC: tas2770: Fix calling reset in probe
Browse files Browse the repository at this point in the history
tas2770_reset is called during i2c probe. The reset calls the
snd_soc_component_write which depends on the tas2770->component being
available. The component pointer is not set until codec_probe so move
the reset to the codec_probe after the pointer is set.

Fixes: 1a476ab ("tas2770: add tas2770 smart PA kernel driver")
Signed-off-by: Dan Murphy <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Dan Murphy authored and broonie committed Sep 21, 2020
1 parent 5f2df2a commit b0bcbe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/codecs/tas2770.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ static int tas2770_codec_probe(struct snd_soc_component *component)

tas2770->component = component;

tas2770_reset(tas2770);

return 0;
}

Expand Down Expand Up @@ -771,8 +773,6 @@ static int tas2770_i2c_probe(struct i2c_client *client,
tas2770->channel_size = 0;
tas2770->slot_width = 0;

tas2770_reset(tas2770);

result = tas2770_register_codec(tas2770);
if (result)
dev_err(tas2770->dev, "Register codec failed.\n");
Expand Down

0 comments on commit b0bcbe6

Please sign in to comment.