esoc: add support for additonal physical link info

Some of the device configurations support multiple external SOCs.
To differentiate physical links, add support for additonal info
about the physical link.

CRs-Fixed: 2024578
Change-Id: If71bf23d798f8bf0b6594a686415fe9b806e4226
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
diff --git a/drivers/esoc/esoc_client.c b/drivers/esoc/esoc_client.c
index b9d6833..446735c 100644
--- a/drivers/esoc/esoc_client.c
+++ b/drivers/esoc/esoc_client.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -44,7 +44,7 @@
 	struct device_node *np = dev->of_node;
 	struct esoc_clink *esoc_clink;
 	struct esoc_desc *desc;
-	char *esoc_name, *esoc_link;
+	char *esoc_name, *esoc_link, *esoc_link_info;
 
 	for (index = 0;; index++) {
 		esoc_prop = kasprintf(GFP_KERNEL, "esoc-%d", index);
@@ -86,16 +86,26 @@
 			kfree(esoc_name);
 			return ERR_PTR(-ENOMEM);
 		}
+		esoc_link_info = kasprintf(GFP_KERNEL, "%s",
+					esoc_clink->link_info);
+		if (IS_ERR_OR_NULL(esoc_link_info)) {
+			dev_err(dev, "unable to alloc link info name\n");
+			kfree(esoc_name);
+			kfree(esoc_link);
+			return ERR_PTR(-ENOMEM);
+		}
 		desc = devres_alloc(devm_esoc_desc_release,
 						sizeof(*desc), GFP_KERNEL);
 		if (IS_ERR_OR_NULL(desc)) {
 			kfree(esoc_name);
 			kfree(esoc_link);
+			kfree(esoc_link_info);
 			dev_err(dev, "unable to allocate esoc descriptor\n");
 			return ERR_PTR(-ENOMEM);
 		}
 		desc->name = esoc_name;
 		desc->link = esoc_link;
+		desc->link_info = esoc_link_info;
 		desc->priv = esoc_clink;
 		devres_add(dev, desc);
 		return desc;