From 9dc9e26bed1506f76fb481c9030bdf700bcb4e7b Mon Sep 17 00:00:00 2001 From: Ajay Singh Parmar Date: Wed, 2 Mar 2022 23:05:10 -0800 Subject: [PATCH] disp: msm: hdcp: set default topology as DOWN_REQUEST_TOPOLOGY Avoid unnecessary write call to set the read request type. As there is just one message to be read, use it as a default value. Change-Id: Ibf1c16f06753ae581dcc32d075ea5d920229f44c Signed-off-by: Ajay Singh Parmar --- hdcp/msm_hdcp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hdcp/msm_hdcp.c b/hdcp/msm_hdcp.c index 039e8f26..16292b89 100644 --- a/hdcp/msm_hdcp.c +++ b/hdcp/msm_hdcp.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. */ @@ -135,8 +136,8 @@ static ssize_t tp_show(struct device *dev, struct device_attribute *attr, ret += sizeof(struct HDCP_V2V1_MSG_TOPOLOGY); - /* clear the flag once data is read back to user space*/ - hdcp->tp_msgid = -1; + /* reset the flag once the data is written back to user space */ + hdcp->tp_msgid = DOWN_REQUEST_TOPOLOGY; break; default: ret = -EINVAL; @@ -290,6 +291,8 @@ static int msm_hdcp_probe(struct platform_device *pdev) if (ret) pr_err("unable to register msm_hdcp sysfs nodes\n"); + hdcp->tp_msgid = DOWN_REQUEST_TOPOLOGY; + return 0; error_cdev_add: device_destroy(hdcp->class, hdcp->dev_num);