Message ID | 20221114165924.33487-1-sven@svenpeter.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2253331wru; Mon, 14 Nov 2022 09:03:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Ylwcy4N35l30pmJVW6eFieyDfG3khgM8fd+p54j0mNeX4alAHN3e1PqPtHlbarRL7q1rl X-Received: by 2002:a17:902:cf4a:b0:188:b6e0:6a96 with SMTP id e10-20020a170902cf4a00b00188b6e06a96mr61844plg.167.1668445383927; Mon, 14 Nov 2022 09:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668445383; cv=none; d=google.com; s=arc-20160816; b=YeJLIAYQylCCK9paWCoaWHhvCvP0S8a9VYXaie6qZl5yc1BSc5/XCKsnnH2uxfQyJ3 D/qmfaOKiNuCgAYVkNKsJiBhHGbdCGgrjzPwakCkIc5QLa73Be1xNWswDF56i/ntEruN H75ItbuWs5/0faclH8ZLbzf10lpadGNoPjjbFU918qO22vWl85l4NN+x9eiXUDc/dG10 J4gBe7H/2QUpr/YklByrpqcEBQzmkoUPxapMGkbS2Y63z3QIgy1rDbwuQF8xR8mxgxBu IJ8u5O4aGHTh9DZbq7PNalada0t0nrj2XM63vDhevH3gHvm47ePpmc0k76VgegHffSfc QfRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:feedback-id:dkim-signature :dkim-signature; bh=yKRgGvprbcoIqEkAWWNc2PNyMEcpae3Af/heeqEz8UQ=; b=EPJuQkN4scfpSEvZPMQYZC8+GuHsVRitWgVWOO8AATfTqFvwIXg3SXUGpj977u8l7S UZezc5Ecpb/wo/VCGxsFFfoJIh/Lo9rASyFCM5/zcKpJrmlNsVB8zNvgOntnmkLNx8Ew AJ1VXuq2Ca+LMP0NoyE5A2JAuMoOGW0Vb061eHJFhTHRI97Gj91aM7zcHH9+RMrHDAqW +r2atemxTGQ0gmKv5CXZQBYn9hPkU24768TAYB9gEurHk45wk/eVcv21oF5UaX00MA10 OrxgGovGEVrKk8dCRkz+slg4jJf3cqHRAdiQ3YJFzkZnDrtE0UHf/wp6qT0MGf1C2WGM /UXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm1 header.b=iOsUoNfH; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=T32XE8s2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y192-20020a638ac9000000b004388f47a0b1si9639100pgd.572.2022.11.14.09.02.47; Mon, 14 Nov 2022 09:03:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm1 header.b=iOsUoNfH; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=T32XE8s2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238114AbiKNRAs (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 12:00:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238108AbiKNRAN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 12:00:13 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A4F8317CF; Mon, 14 Nov 2022 08:59:35 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 17FDC5C0197; Mon, 14 Nov 2022 11:59:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 14 Nov 2022 11:59:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1668445172; x=1668531572; bh=yKRgGvprbc oIqEkAWWNc2PNyMEcpae3Af/heeqEz8UQ=; b=iOsUoNfHwTvT0XulboXuoSXg/k 2G1WgarGXIWbdDvh/mz+3P4qmXmoXgVrmXE3irKW3Ev8dr+6TX2DCyCkT1Uw4Pn5 pnyhGdLUQ+PBbVonXW/d9u6F2Hi0XaQP0FwV0k2s+70ADMhhChA6w/qBqWUnlb0l nhXTy1V1K/99LvkwzsddgtCZGCswmA+uLopbmfqt2bfGtggfwrDUDE6UUL0ck2aQ juUX49UKP7//5Rxa+caLYLuku+taXmO7iUohrrHdfckmsakiRPSs7NJrnE1CULoG IgBZ251kA9cA38NKqVTQWRd1N7iXuy4Z34AtDWkToVyjljVpCGln5i1ykArw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1668445172; x=1668531572; bh=yKRgGvprbcoIqEkAWWNc2PNyMEcpae3Af/h eeqEz8UQ=; b=T32XE8s2ywBn+GqAV1ujFSrQIje1n1zhqOEAD/4bABuM9CfpPF8 EQBEkT0yoEJ6KsaSfTTrJHW4Wz9j+JvQu1r/IVBiyKT/RGVh4F/zB4Tq46sJ8kRG PsJtvoOQTdyJwwEPtNFGXZJzMuGOd00i6D4lKKcgUE1u9KU6lVE1xRliyNE9/VSR SuNRjynMHSsCNHg6bIL6mR07Tal97PVXmhR2Ucj60e+n/D+nBIPIlsvd/Px/GqNn TvzxZqEe2aZBHcdGiB5eyVofd5fqJQSzZhNqkLCLN7dhztizfeH1Fja1cHX6YuhE jPbUlpx2WGqigMS0SiB5uOzKr0xBcB0LzyQ== X-ME-Sender: <xms:83NyY6vfb1bUjeof0I70mLX2b6zF9tXYGkrmOcQb5wIaxWQi3YLJWw> <xme:83NyY_f5LxREFsWGIbm6Hx249Xl-GHX3JqU4Dk0Vucw60cNRQ0O-z9RONt_BR--Ya jqa1rPkHWCNhHOEfhg> X-ME-Received: <xmr:83NyY1ywFUw4MfCiAn4_Lvnjpyhjw5_exALQbaYEoeswwXWIY-J4fu5xetikz0EtQWxFgyoE7XhooxFPRhnncG12gS8VPqahr7szK1w5moOdzGM6GMk-6bzIpXJ9pg> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedvgdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuvhgvnhcurfgv thgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrthhtvghrnh epleduffeiheeuvedtffevtdeuleeljeduudfgtedtvefhfeffvdfghfejhefgleelnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshhvvghnse hsvhgvnhhpvghtvghrrdguvghv X-ME-Proxy: <xmx:83NyY1MrYoPAtbm6nDzuAzXqcV-8qqrPQvfteyDmhD7U6yyKskYnZg> <xmx:83NyY6_IgEoU_VwHvctKI148NJRHRtqvfdXOxZLTnqv-vKCr3MTeYQ> <xmx:83NyY9VIXbGpiPlycWcQwd5NOhw_LkxjN3emDmuM3UWdGxFBcl9x6g> <xmx:9HNyYxYUtIQJLJ_bSSdSbXrX37p6CVuSvCMCq0U5KeqpteBckaH63Q> Feedback-ID: i51094778:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 14 Nov 2022 11:59:31 -0500 (EST) From: Sven Peter <sven@svenpeter.dev> To: Heikki Krogerus <heikki.krogerus@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Sven Peter <sven@svenpeter.dev>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: typec: Check for ops->exit instead of ops->enter in altmode_exit Date: Mon, 14 Nov 2022 17:59:24 +0100 Message-Id: <20221114165924.33487-1-sven@svenpeter.dev> X-Mailer: git-send-email 2.30.1 (Apple Git-130) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749491786785486104?= X-GMAIL-MSGID: =?utf-8?q?1749491786785486104?= |
Series |
usb: typec: Check for ops->exit instead of ops->enter in altmode_exit
|
|
Commit Message
Sven Peter
Nov. 14, 2022, 4:59 p.m. UTC
typec_altmode_exit checks if ops->enter is not NULL but then calls
ops->exit a few lines below. Fix that and check for the function
pointer it's about to call instead.
Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes")
Signed-off-by: Sven Peter <sven@svenpeter.dev>
---
drivers/usb/typec/bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Nov 14, 2022 at 05:59:24PM +0100, Sven Peter wrote: > typec_altmode_exit checks if ops->enter is not NULL but then calls > ops->exit a few lines below. Fix that and check for the function > pointer it's about to call instead. > > Fixes: 8a37d87d72f0 ("usb: typec: Bus type for alternate modes") > Signed-off-by: Sven Peter <sven@svenpeter.dev> No Cc: stable@...? Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> > --- > drivers/usb/typec/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/bus.c b/drivers/usb/typec/bus.c > index 26ea2fdec17d..31c2a3130cad 100644 > --- a/drivers/usb/typec/bus.c > +++ b/drivers/usb/typec/bus.c > @@ -134,7 +134,7 @@ int typec_altmode_exit(struct typec_altmode *adev) > if (!adev || !adev->active) > return 0; > > - if (!pdev->ops || !pdev->ops->enter) > + if (!pdev->ops || !pdev->ops->exit) > return -EOPNOTSUPP; > > /* Moving to USB Safe State */ thanks,
diff --git a/drivers/usb/typec/bus.c b/drivers/usb/typec/bus.c index 26ea2fdec17d..31c2a3130cad 100644 --- a/drivers/usb/typec/bus.c +++ b/drivers/usb/typec/bus.c @@ -134,7 +134,7 @@ int typec_altmode_exit(struct typec_altmode *adev) if (!adev || !adev->active) return 0; - if (!pdev->ops || !pdev->ops->enter) + if (!pdev->ops || !pdev->ops->exit) return -EOPNOTSUPP; /* Moving to USB Safe State */