ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization
authorThierry Escande <thierry.escande@collabora.com>
Fri, 8 Sep 2017 05:13:08 +0000 (00:13 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Aug 2018 18:59:29 +0000 (20:59 +0200)
commit5daf24711f653f695352c3f916b70fa227bf9a78
tree75961d2c2fd673df29af4e84305a8d96d143565c
parentb7c2b69911f84b6819d300c8b2849c04a1b782f0
ASoC: Intel: cht_bsw_max98090_ti: Fix jack initialization

commit 3bbda5a38601f7675a214be2044e41d7749e6c7b upstream.

If the ts3a227e audio accessory detection hardware is present and its
driver probed, the jack needs to be created before enabling jack
detection in the ts3a227e driver. With this patch, the jack is
instantiated in the max98090 headset init function if the ts3a227e is
present. This fixes a null pointer dereference as the jack detection
enabling function in the ts3a driver was called before the jack is
created.

[minor correction to keep error handling on jack creation the same
as before by Pierre Bossart]

Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Acked-By: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/intel/boards/cht_bsw_max98090_ti.c