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 19:01:11 +0000 (21:01 +0200)
commit9efed51870be4cca7725da7bcebf4cffb4b8f1a9
tree2e0e2892e139aa8325fbe5b45ef20bece55c5ebe
parent643a9d6d4ff70c3e6580014299bba3e75e3dc620
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