Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3985237imj; Tue, 12 Feb 2019 07:58:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IYhNEh6dGX48l9wzL8CHF1y5GxEWtoZvb6DX0MN1USJ6AoQeLtmeCWggl4tL03hiyUqpwId X-Received: by 2002:a63:9246:: with SMTP id s6mr4169776pgn.349.1549987123774; Tue, 12 Feb 2019 07:58:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549987123; cv=none; d=google.com; s=arc-20160816; b=F6MIHdsHv+eTF7eB4Ya+lCfy18NryEZ2BL/UNfzBjse5wgO2Yyj+TOWoFYg9UWdy6O kI/bLK0rZ9qeVd2l4PG+kd34vckRgNjmbeBvWVKzfUhPvAV7kQleWDpXM8ZFU5x6yLt/ nlJEINOAUU+gqy0pIyn4QQi82YQ66p0NzT654keCiPk++QZSka86hpO6PcXTgXTOzjGI n2Lcsik5HQSNAjhHu9R/cBMbB09qhlPldxFIWntmn8M2MP5khzO/KPc9re6oJBuQZWjw J6bbcsn6vUcgthj/4Sbf937+jK5mBTH02HfUoFMIVOrfvbH8vfe8DWyD3RqWC1BqinIH oG6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=oyv/ZkAJe4nSxbOi2lYYeF6GzshBE2yMeOf1hqT3IEY=; b=UddxwnVwGP92+pERYu7kvEqL0MQvuLngSH1pSKAtrUlHQ94iKTsceKx7qNoclsbUBK +VxxqeZo+KJZUI8bwWnICSLMR8L+YpWdEaddKUvrI57Jb67NYCgOnZxe5jpXfoPli7/a f1ZjUB41KlGMGHSA7xC2mRKrNFoiS9eIfopkiUpoLCaVW2cyVROlAnh96LdaBdPZYdmV nGundLA2MJ26zvDDvEDm5BwZcy36jxfXb0m2pHPzY1k7CIfS+N7kc2JzdV+viod4tuo4 7EKRx/gw6CDmAi5e6cy1EqbbqBPpAzKvA3Dr9h0xm5LBOG0FLNOeEaysII+PKmASSlLn wGIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="U6Q/FRTw"; 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 g124si12094897pgc.568.2019.02.12.07.58.27; Tue, 12 Feb 2019 07:58:43 -0800 (PST) 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; dkim=fail header.i=@gmail.com header.s=20161025 header.b="U6Q/FRTw"; 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 S1730769AbfBLP6W (ORCPT + 99 others); Tue, 12 Feb 2019 10:58:22 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35143 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730006AbfBLP6W (ORCPT ); Tue, 12 Feb 2019 10:58:22 -0500 Received: by mail-pg1-f196.google.com with SMTP id s198so1456455pgs.2; Tue, 12 Feb 2019 07:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=oyv/ZkAJe4nSxbOi2lYYeF6GzshBE2yMeOf1hqT3IEY=; b=U6Q/FRTw4l6P/djMILqkCTEjZ4vMCbZxhNN8c7pDvn3FsSgEBg4bTvJFYEfJ47U1m3 2J1uuQm338esTZfKr/3r+VcpQivrd+mqzqfJhVbpXEETomhSdmbwz5YfcnCack9FGI8n tZ7Vr5KJ+cHyIe9aDOeSTBMO+ffHIg5Rya4gz3fS2AOemKwU9yaXN6RGFf5fB29Z2eUg IspBOz9khWFLShAE7TpVdvYc4jQOAOpp3yo4qFpNaOsQp0BUe1QzTeWprlzDVScgJb+w d4THb5+WyehUcocjza7N+h3I0HULydw6uhIXubcK8iKumT41SlYcbfKrIlEtKrM7E48u x9Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=oyv/ZkAJe4nSxbOi2lYYeF6GzshBE2yMeOf1hqT3IEY=; b=p5ESQFG4Zha5TpO0bIVzPOTTqXnLupy5tpsy7DkSTOZDe6TRORAtFtcUg+m7JdFvv8 BaqCFfrGEiFUNRf+6BMoiCBktyWozTaUBO9byGI3aWtlDmUKeoUw3qvJp3SGdAX+6mIP 4BfB8geqoCHqyPoiSlMRSCHBwvzU+CajPnYZjjNQdN/EaBVrZj/8rDPBnF6GqBvLiFMP 3JqC8qK3TciYzZjORbdw9bYCwwcCAL3mWZnEA2VFSQvk7yGgsSBv5Ls3rq65/v6Gof4W 2o06nynEJnndfWzHidPSYgDD86zHnKclZkNrey+hV1TX5Sn5UwGL+RZJWO8qQrOycpRw Hz8Q== X-Gm-Message-State: AHQUAuY7HkjPhmaNFzwOazV0vBNpPEaTzeG+TC6vyhY5vgI7wDA3a0Lj nbVy3NrbQTBu8G8nkpVqSo840ayY X-Received: by 2002:a62:2044:: with SMTP id g65mr4567549pfg.127.1549987101476; Tue, 12 Feb 2019 07:58:21 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c13sm27123395pfe.93.2019.02.12.07.58.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 07:58:20 -0800 (PST) From: Guenter Roeck To: Heikki Krogerus Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Guenter Roeck , Kyle Tso Subject: [PATCH] usb: typec: tcpm: Remove unused functions Date: Tue, 12 Feb 2019 07:58:17 -0800 Message-Id: <1549987097-27937-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tcpm_update_source_capabilities() and tcpm_update_sink_capabilities() are not used anywhere, and I don't recall why I introduced those functions in the first place. Effectively that means that we don't know if they even work, or ever did. Lets remove them. Reported-by: Kyle Tso Cc: Kyle Tso Signed-off-by: Guenter Roeck --- drivers/usb/typec/tcpm/tcpm.c | 60 ------------------------------------------- include/linux/usb/tcpm.h | 6 ----- 2 files changed, 66 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index f1c39a3c7534..a6b2413c59a6 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -4435,66 +4435,6 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, return 0; } -int tcpm_update_source_capabilities(struct tcpm_port *port, const u32 *pdo, - unsigned int nr_pdo) -{ - if (tcpm_validate_caps(port, pdo, nr_pdo)) - return -EINVAL; - - mutex_lock(&port->lock); - port->nr_src_pdo = tcpm_copy_pdos(port->src_pdo, pdo, nr_pdo); - switch (port->state) { - case SRC_UNATTACHED: - case SRC_ATTACH_WAIT: - case SRC_TRYWAIT: - tcpm_set_cc(port, tcpm_rp_cc(port)); - break; - case SRC_SEND_CAPABILITIES: - case SRC_NEGOTIATE_CAPABILITIES: - case SRC_READY: - case SRC_WAIT_NEW_CAPABILITIES: - tcpm_set_cc(port, tcpm_rp_cc(port)); - tcpm_set_state(port, SRC_SEND_CAPABILITIES, 0); - break; - default: - break; - } - mutex_unlock(&port->lock); - return 0; -} -EXPORT_SYMBOL_GPL(tcpm_update_source_capabilities); - -int tcpm_update_sink_capabilities(struct tcpm_port *port, const u32 *pdo, - unsigned int nr_pdo, - unsigned int operating_snk_mw) -{ - if (tcpm_validate_caps(port, pdo, nr_pdo)) - return -EINVAL; - - mutex_lock(&port->lock); - port->nr_snk_pdo = tcpm_copy_pdos(port->snk_pdo, pdo, nr_pdo); - port->operating_snk_mw = operating_snk_mw; - port->update_sink_caps = true; - - switch (port->state) { - case SNK_NEGOTIATE_CAPABILITIES: - case SNK_NEGOTIATE_PPS_CAPABILITIES: - case SNK_READY: - case SNK_TRANSITION_SINK: - case SNK_TRANSITION_SINK_VBUS: - if (port->pps_data.active) - tcpm_set_state(port, SNK_NEGOTIATE_PPS_CAPABILITIES, 0); - else - tcpm_set_state(port, SNK_NEGOTIATE_CAPABILITIES, 0); - break; - default: - break; - } - mutex_unlock(&port->lock); - return 0; -} -EXPORT_SYMBOL_GPL(tcpm_update_sink_capabilities); - /* Power Supply access to expose source power information */ enum tcpm_psy_online_states { TCPM_PSY_OFFLINE = 0, diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h index 50c74a77db55..0c532ca3f079 100644 --- a/include/linux/usb/tcpm.h +++ b/include/linux/usb/tcpm.h @@ -159,12 +159,6 @@ struct tcpm_port; struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc); void tcpm_unregister_port(struct tcpm_port *port); -int tcpm_update_source_capabilities(struct tcpm_port *port, const u32 *pdo, - unsigned int nr_pdo); -int tcpm_update_sink_capabilities(struct tcpm_port *port, const u32 *pdo, - unsigned int nr_pdo, - unsigned int operating_snk_mw); - void tcpm_vbus_change(struct tcpm_port *port); void tcpm_cc_change(struct tcpm_port *port); void tcpm_pd_receive(struct tcpm_port *port, -- 2.7.4