summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorChristopher N. Hesse <raymanfx@gmail.com>2018-07-12 13:51:43 +0200
committerChristopher N. Hesse <raymanfx@gmail.com>2018-07-12 13:53:18 +0200
commitc487bbe38958d79aa7391b928f15e9ed5f8d1d4b (patch)
tree95e72cd7376a019bfb9f0c427490a145691ea879 /audio
parent0b52b58af8d61f6d034befd6557a3790bf908016 (diff)
downloadandroid_hardware_samsung-c487bbe38958d79aa7391b928f15e9ed5f8d1d4b.tar.gz
android_hardware_samsung-c487bbe38958d79aa7391b928f15e9ed5f8d1d4b.tar.bz2
android_hardware_samsung-c487bbe38958d79aa7391b928f15e9ed5f8d1d4b.zip
audio: improve log message to support for devices that dont have an amp
Change-Id: I3fe824c4dbdb57bb0d63b395cfcef2f9dbbe556b Signed-off-by: Abhay Ruparel <abhayruparel2000@gmail.com>
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 8194d1f..f97758c 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -218,6 +218,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;
@@ -4371,7 +4375,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");
}