Skip to content

Commit b0bcbe6

Browse files
Dan Murphybroonie
authored andcommitted
ASoC: tas2770: Fix calling reset in probe
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 <dmurphy@ti.com> Link: https://lore.kernel.org/r/20200918190548.12598-1-dmurphy@ti.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 5f2df2a commit b0bcbe6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/soc/codecs/tas2770.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ static int tas2770_codec_probe(struct snd_soc_component *component)
575575

576576
tas2770->component = component;
577577

578+
tas2770_reset(tas2770);
579+
578580
return 0;
579581
}
580582

@@ -771,8 +773,6 @@ static int tas2770_i2c_probe(struct i2c_client *client,
771773
tas2770->channel_size = 0;
772774
tas2770->slot_width = 0;
773775

774-
tas2770_reset(tas2770);
775-
776776
result = tas2770_register_codec(tas2770);
777777
if (result)
778778
dev_err(tas2770->dev, "Register codec failed.\n");

0 commit comments

Comments
 (0)