Fix platform_get_snd_device_name_extn functions.
This was showing up as a const cast, but those lines were completely
wrong. C does not work that way. Replace them with a strlcpy which
appears to be what was intended.
Note this removes a device_name NULL check. Looking through callers, no
one ever passes in NULL, and no other platform_get_snd_device_name_extn
implementation ever checks for it.
Test: Still compiles. Device boots.
Change-Id: I5d71550f8f3891aacdf8d8aa95c3cd6094aa4701
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index a5a2c9b..5f32fe4 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -1040,7 +1040,7 @@
{
struct platform_data *my_data = (struct platform_data *)platform;
- if (platform == NULL || device_name == NULL) {
+ if (platform == NULL) {
ALOGW("%s: something wrong, use legacy get_snd_device name", __func__);
strlcpy(device_name, platform_get_snd_device_name(snd_device),
DEVICE_NAME_MAX_SIZE);