[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ace068c-5ec7-7e2b-0aa5-56cb59a55f7e@linux.intel.com>
Date: Thu, 16 Jul 2020 11:48:06 -0500
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Hans de Goede <hdegoede@...hat.com>,
Jing Xiangfeng <jingxiangfeng@...wei.com>,
cezary.rojewski@...el.com, liam.r.girdwood@...ux.intel.com,
yang.jie@...ux.intel.com, broonie@...nel.org, perex@...ex.cz,
tiwai@...e.com, kuninori.morimoto.gx@...esas.com,
paul@...pouillou.net
Cc: alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ASoC: Intel: bytcht_es8316: Add missed put_device()
>>>> snd_byt_cht_es8316_mc_probe() misses to call put_device() in an error
>>>> path. Add the missed function call to fix it.
>>>>
>>>> Fixes: ba49cf6f8e4a ("ASoC: Intel: bytcht_es8316: Add quirk for
>>>> inverted jack detect")
>>>> Signed-off-by: Jing Xiangfeng <jingxiangfeng@...wei.com>
>>>
>>> Patch looks good to me:
>>>
>>> Reviewed-by: Hans de Goede <hdegoede@...hat.com>
>>
>> Actually the existing code looks quite odd to me:
>>
>> if (cnt) {
>> ret = device_add_properties(codec_dev, props);
>> if (ret)
>> return ret;
>> }
>>
>> devm_acpi_dev_add_driver_gpios(codec_dev, byt_cht_es8316_gpios);
>> priv->speaker_en_gpio =
>> gpiod_get_index(codec_dev, "speaker-enable", 0,
>> /* see comment in byt_cht_es8316_resume */
>> GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE);
>> put_device(codec_dev);
>>
>> if the first branch is not taken the put_device() will not be balanced.
>
> The get_device() does not come from the device_add_properties, it comes
> from the earlier:
>
> codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, codec_name);
>
> call.
I probably needed more coffee when I wrote this, indeed this is fine...
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
Powered by blists - more mailing lists