[alsa-devel] [PATCH v2 02/23] ASoC: tas2552: Fix kernel crash when the codec is loaded but not part of a card
Peter Ujfalusi
peter.ujfalusi at ti.com
Fri Jun 5 08:57:59 CEST 2015
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.
--
Péter
More information about the Alsa-devel
mailing list