UPSTREAM: ASoC: rt5645: Use devm_gpiod_get_optional for hp-detect

Since hp-detect is optional, use devm_gpiod_get_optional instead.
In additional, it should return error if devm_gpiod_get_optional fails.

BUG=chrome-os-partner:40528
TEST=Test headset detection on oak-rev2

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 25c8888ad65f812c847ae58398a5f8f1b20b0a95)
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>

Change-Id: I92293790a36a138bfa861c3f8d03eacf3a164774
Reviewed-on: https://chromium-review.googlesource.com/277554
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Trybot-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
1 file changed