From: Christopher N. Hesse Date: Thu, 12 Jul 2018 11:51:43 +0000 (+0200) Subject: audio: improve log message to support for devices that dont have an amp X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ad169fc9afdd584bd11251d37f4834c41fa6efff;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung.git audio: improve log message to support for devices that dont have an amp Change-Id: I3fe824c4dbdb57bb0d63b395cfcef2f9dbbe556b Signed-off-by: Abhay Ruparel (cherry picked from commit c487bbe38958d79aa7391b928f15e9ed5f8d1d4b) --- diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 94c105f..1e99dcb 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -201,6 +201,10 @@ static int amplifier_open(void) rc = hw_get_module(AMPLIFIER_HARDWARE_MODULE_ID, (const hw_module_t **) &module); if (rc) { + if (rc == -ENOENT) { + // no amplifier HAL present + return -ENOENT; + } ALOGV("%s: Failed to obtain reference to amplifier module: %s\n", __func__, strerror(-rc)); return -ENODEV; @@ -4309,7 +4313,7 @@ static int adev_open(const hw_module_t *module, const char *name, return -EINVAL; } - if (amplifier_open() != 0) { + if (amplifier_open() != -ENOENT) { ALOGE("Amplifier initialization failed"); }