Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1431041ybb; Thu, 9 Apr 2020 01:53:58 -0700 (PDT) X-Google-Smtp-Source: APiQypKvuOpc6K9beSqtwBoBvySzgJJnjqrp4AK/GtATNk3DHI+526qQdTDAkmHZ8jwH/XHsBVTj X-Received: by 2002:aca:c145:: with SMTP id r66mr437498oif.90.1586422438507; Thu, 09 Apr 2020 01:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586422438; cv=none; d=google.com; s=arc-20160816; b=CuAwonPlzx9EufW1P2EwmN73Rl8l87rtJR4zNOv2R9TvkR2y0/ALgvvrX0f9lB2JTp LS1i5OcdbiiY2PM3PBzdRrw+aLUKal8tYbeT7lu/mDew+/rcHJvX7fP7SiMRQSZiwF5K HG1R4aLwVCNFMC9oEC4WqyVfyrxdPnOVXuFJVi7jJ/nIirw6f3CzDp1DYLNSzSR/h58S J7nBrvNtRZ+N24+i+FdqBoR2k76U3xd6dMIPkwbkWM10AN6oi6XP/7GsW64hfjkVzJMf PBnGDoBCofU1LVsRpsoQFKBXZR4tGbwg4959l9FDRBG1S4w+aSvUqBX/BMlbA80XCpwc Sr8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=dOKHHEzLfsqI1oD0X7e07Jq6gjDZj0b4vW8Mw6XGhfE=; b=S23duuZPDO8kpVVNLv/ZQ5kbOhCd7gm47BAVtxIsg1cwONmfEon0fAj3s8imPLdLst SYqqLtmiZQDTkN6Rp1GRwrs44YZKDaCV3DTS2awCBecAbhRhxJuX3/5FT/qlU3RjajgN Ox8rMuVEGAu5guU0WCAFh3tRwZA7J8Ec1uJrQ26grNBm6tbcpw14kwshGLZMP6Lmo0d6 +3SyqLnQ+cdUnuW1HQb42326fDtKYmBtJHC9jZQc6w98xBFx4XqUZAk7yl9xcbdHJ/cj pI+0hs81TF17n9On1p50DG9I4JhKRzG+jIn2Nr4e3eQW9BWsk6pJ6rkrm25vg1Xr2ofI D9oQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si2978766oix.67.2020.04.09.01.53.43; Thu, 09 Apr 2020 01:53:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbgDIIxE (ORCPT + 99 others); Thu, 9 Apr 2020 04:53:04 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:57344 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725783AbgDIIxE (ORCPT ); Thu, 9 Apr 2020 04:53:04 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B15C5BECF9A5BA504953; Thu, 9 Apr 2020 16:52:52 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Thu, 9 Apr 2020 16:52:43 +0800 From: Jason Yan To: , , , , CC: Jason Yan Subject: [PATCH] usb: typec: tcpm: remove tcpm_altmode_ops and associations Date: Thu, 9 Apr 2020 16:51:17 +0800 Message-ID: <20200409085117.45819-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following gcc warning: drivers/usb/typec/tcpm/tcpm.c:1551:39: warning: ‘tcpm_altmode_ops’ defined but not used [-Wunused-const-variable=] static const struct typec_altmode_ops tcpm_altmode_ops = { ^~~~~~~~~~~~~~~~ Reported-by: Hulk Robot Signed-off-by: Jason Yan --- drivers/usb/typec/tcpm/tcpm.c | 51 ----------------------------------- 1 file changed, 51 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index de3576e6530a..0fcb1023bdbe 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1503,57 +1503,6 @@ static int tcpm_validate_caps(struct tcpm_port *port, const u32 *pdo, return 0; } -static int tcpm_altmode_enter(struct typec_altmode *altmode, u32 *vdo) -{ - struct tcpm_port *port = typec_altmode_get_drvdata(altmode); - u32 header; - - mutex_lock(&port->lock); - header = VDO(altmode->svid, vdo ? 2 : 1, CMD_ENTER_MODE); - header |= VDO_OPOS(altmode->mode); - - tcpm_queue_vdm(port, header, vdo, vdo ? 1 : 0); - mod_delayed_work(port->wq, &port->vdm_state_machine, 0); - mutex_unlock(&port->lock); - - return 0; -} - -static int tcpm_altmode_exit(struct typec_altmode *altmode) -{ - struct tcpm_port *port = typec_altmode_get_drvdata(altmode); - u32 header; - - mutex_lock(&port->lock); - header = VDO(altmode->svid, 1, CMD_EXIT_MODE); - header |= VDO_OPOS(altmode->mode); - - tcpm_queue_vdm(port, header, NULL, 0); - mod_delayed_work(port->wq, &port->vdm_state_machine, 0); - mutex_unlock(&port->lock); - - return 0; -} - -static int tcpm_altmode_vdm(struct typec_altmode *altmode, - u32 header, const u32 *data, int count) -{ - struct tcpm_port *port = typec_altmode_get_drvdata(altmode); - - mutex_lock(&port->lock); - tcpm_queue_vdm(port, header, data, count - 1); - mod_delayed_work(port->wq, &port->vdm_state_machine, 0); - mutex_unlock(&port->lock); - - return 0; -} - -static const struct typec_altmode_ops tcpm_altmode_ops = { - .enter = tcpm_altmode_enter, - .exit = tcpm_altmode_exit, - .vdm = tcpm_altmode_vdm, -}; - /* * PD (data, control) command handling functions */ -- 2.17.2