From 51467ac1d6e31d7f5940ed883d9f32e2fb4c90aa Mon Sep 17 00:00:00 2001 From: Guru Das Srinagesh Date: Wed, 18 Mar 2020 21:05:31 -0700 Subject: [PATCH] soc: altmode: Remove altmode device name Remove the device tree property "qcom,altmode-name" and the logic it feeds as it was meant to help in the cases when there are multiple altmode devices. Since there is going to be only one altmode device as per design, this is no longer needed. Change-Id: Ife15e39becee5f4ff03bdcc56ff62ae812fe2726 Signed-off-by: Guru Das Srinagesh --- drivers/soc/qcom/altmode-glink.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/soc/qcom/altmode-glink.c b/drivers/soc/qcom/altmode-glink.c index 1f897229e727..e721cc197f76 100644 --- a/drivers/soc/qcom/altmode-glink.c +++ b/drivers/soc/qcom/altmode-glink.c @@ -24,8 +24,6 @@ #define USBC_CMD_WRITE_REQ 0x15 #define USBC_NOTIFY_IND 0x16 -#define ALTMODE_NAME_MAX_LEN 10 - #define MAX_NUM_PORTS 4 #define IDR_KEY_GEN(svid, ind) (((svid) << 8) | (ind)) @@ -49,7 +47,6 @@ struct usbc_write_buffer_req_msg { * Definition of an altmode device. * * @dev: Altmode parent device for all client devices - * @name: Short descriptive name of this altmode device * @pgclient: PMIC GLINK client to talk to remote subsystem * @client_idr: idr list for altmode clients * @client_lock: mutex protecting changes to client_idr @@ -60,7 +57,6 @@ struct usbc_write_buffer_req_msg { */ struct altmode_dev { struct device *dev; - char name[ALTMODE_NAME_MAX_LEN]; struct pmic_glink_client *pgclient; struct idr client_idr; struct mutex client_lock; @@ -535,7 +531,6 @@ static void altmode_notify_clients(struct altmode_dev *amdev) static int altmode_probe(struct platform_device *pdev) { int rc; - const char *str = NULL; struct altmode_dev *amdev; struct pmic_glink_client_data pgclient_data = { }; struct device *dev = &pdev->dev; @@ -544,21 +539,7 @@ static int altmode_probe(struct platform_device *pdev) if (!amdev) return -ENOMEM; - rc = of_property_read_string(dev->of_node, "qcom,altmode-name", - &str); - if (rc < 0) { - dev_err(dev, "No altmode device name specified: %d\n", rc); - return rc; - } - - if (!str || (strlen(str) >= ALTMODE_NAME_MAX_LEN) || - !str_has_prefix(str, "altmode_")) { - dev_err(dev, "Incorrect altmode device name format\n"); - return -EINVAL; - } - amdev->dev = dev; - strlcpy(amdev->name, str, ALTMODE_NAME_MAX_LEN); mutex_init(&amdev->client_lock); idr_init(&amdev->client_idr);