Message ID | 1433423075-14142-3-git-send-email-peter.ujfalusi@ti.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jun 04, 2015 at 04:04:14PM +0300, Peter Ujfalusi wrote: > If the card is not part of any card the tas_data->codec is NULL since it is > set only during snd_soc_codec_driver.probe, which is not yet called. > @@ -120,6 +120,9 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) > { > u8 cfg1_reg; > > + if (!tas_data->codec) > + return; > + This fixes the crash but isn't whatever the function is doing important (so we should fix by using regmap for the I/O or something)?
On Thu, Jun 04, 2015 at 04:04:14PM +0300, Peter Ujfalusi wrote: > If the card is not part of any card the tas_data->codec is NULL since it is > set only during snd_soc_codec_driver.probe, which is not yet called. Please put bugfixes like this at the start of the series.
On 06/04/2015 07:25 PM, Mark Brown wrote: > On Thu, Jun 04, 2015 at 04:04:14PM +0300, Peter Ujfalusi wrote: >> If the card is not part of any card the tas_data->codec is NULL since it is >> set only during snd_soc_codec_driver.probe, which is not yet called. > >> @@ -120,6 +120,9 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) >> { >> u8 cfg1_reg; >> >> + if (!tas_data->codec) >> + return; >> + > > This fixes the crash but isn't whatever the function is doing important > (so we should fix by using regmap for the I/O or something)? If the driver's snd_soc_codec_driver->probe is not called we do not initialize the amplifier. This function would put the amp to software shutdown, which is the power up state of the amp. Hrm, it should use tas2552 instead of tas_dat for the tas2552_data to be consistent with the rest of the driver. I will add a patch for this in v3.
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index ff82f46ba504..df89947f1032 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -120,6 +120,9 @@ static void tas2552_sw_shutdown(struct tas2552_data *tas_data, int sw_shutdown) { u8 cfg1_reg; + if (!tas_data->codec) + return; + if (sw_shutdown) cfg1_reg = 0; else
If the card is not part of any card the tas_data->codec is NULL since it is set only during snd_soc_codec_driver.probe, which is not yet called. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> --- sound/soc/codecs/tas2552.c | 3 +++ 1 file changed, 3 insertions(+)