From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9375320F for ; Fri, 5 Sep 2025 11:20:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757071235; cv=none; b=B8seYhPjK+q9C4OMiFnbba1KDsKsXq42aG0wZik6n/5VMcwhyC1zj8Q5XJVmZgv4kyTXLtaJiKHr/KOs06QxRdI3OSW6q/AcaW+edTji3ar1nCFPme2QuB4nCES6cxebP7LqCwgQ/m5KI1+nMS7Y9HB3DyF5dS1431jNNFZNe54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757071235; c=relaxed/simple; bh=OGmWrJpLcXWxy4kOfWzDwFhNHI5GSrj775waIjsWVsQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PxwurExQJocprc8sgZmwcZ0orBqIBjQzKQbAcNgUnv4F1jVzqDY9rcmda7VgeAcNeXuVhpXHkN3Jqsy5ZU4htU8PT/li/BjbN2AmrqXsm/tDaj0wYk+TvkvooR8D9m5CHE7H2qMLqfQTHs27IFKUWApvz33gCJccEtgSktQlW60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=YXwa8n18; arc=none smtp.client-ip=192.198.163.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YXwa8n18" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1757071234; x=1788607234; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OGmWrJpLcXWxy4kOfWzDwFhNHI5GSrj775waIjsWVsQ=; b=YXwa8n18lwQKIkjp28cdnWEEqMbWgheVcRLsc8fpRzdHt6pDYYjBk4Mc xFeX2i1IlcaWiRTkYKch0V+yopcNEHz61JACiW6Um6S7ZqgJsmHTsQdzV bufz9g1M3vofuUOe/f5aEJFNN6rSz7Y+KKE+lvkfa5ZTvQ7svhug/s1wf 1uRWI0AlAHgsXa939m0nGe4IajXvjYxfZxgIsoYNOMJfBawVsjKiKsCO0 swJQb2RMGolPv6EFUfjGGIBuxOpUbpZ43ARPGnx555PDyb51ASbvwKk0T LyiOMTgv/z9zjwRRj+ZrN45TB9E5rC3Q3isPTshmfIsy6JeVC4R0icbtC Q==; X-CSE-ConnectionGUID: 7OLAX5SrQYmm+YkdjatACA== X-CSE-MsgGUID: ZzosEBa/TU2ulpQ95kZFdQ== X-IronPort-AV: E=McAfee;i="6800,10657,11543"; a="58633160" X-IronPort-AV: E=Sophos;i="6.18,241,1751266800"; d="scan'208";a="58633160" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2025 04:20:33 -0700 X-CSE-ConnectionGUID: cvFrgh+1Q/O8gYdxESH4AA== X-CSE-MsgGUID: EfmsnKDwRvajVzhRnqz99Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,241,1751266800"; d="scan'208";a="177380651" Received: from kuha.fi.intel.com ([10.237.72.152]) by orviesa005.jf.intel.com with SMTP; 05 Sep 2025 04:20:27 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 05 Sep 2025 14:20:26 +0300 Date: Fri, 5 Sep 2025 14:20:26 +0300 From: Heikki Krogerus To: Sven Peter Cc: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Janne Grunau , Alyssa Rosenzweig , Neal Gompa , Vinod Koul , Kishon Vijay Abraham I , Thinh Nguyen , Philipp Zabel , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org Subject: Re: [PATCH RFC 14/22] usb: typec: tipd: Register DisplayPort and Thunderbolt altmodes for cd321x Message-ID: References: <20250821-atcphy-6-17-v1-0-172beda182b8@kernel.org> <20250821-atcphy-6-17-v1-14-172beda182b8@kernel.org> Precedence: bulk X-Mailing-List: asahi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250821-atcphy-6-17-v1-14-172beda182b8@kernel.org> > +static void > +cd321x_unregister_port(struct tps6598x *tps) > +{ > + struct cd321x *cd321x = container_of(tps, struct cd321x, tps); > + > + if (cd321x->port_altmode_dp) > + typec_unregister_altmode(cd321x->port_altmode_dp); > + if (cd321x->port_altmode_tbt) > + typec_unregister_altmode(cd321x->port_altmode_tbt); You can call typec_unregister_altmode() unconditionally here - it's NULL safe. thanks, > + cd321x->port_altmode_dp = NULL; > + cd321x->port_altmode_tbt = NULL; > + typec_unregister_port(tps->port); > +} -- heikki From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97ECCCA1013 for ; Fri, 5 Sep 2025 14:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=n3iyUkKIX5bIcYXP4efYm1mvncHejOzePASzbnN6gac=; b=3NPd/vBpEJ6Caf +anVvkuiCxm3LlK2gpU6jFo88WZHltMJ2q5TxhlsjIVTvJAJ90mcNY/RNMpe56lsJlMC2+MpcQ7Du qgwyiuudv4uU39bKGY0YFCuMcfC/+49QkR/qmGyTITjUSeLnLkbtC4lsgqMYDUy6UTGifFS2kTr1O QYabWd0lnJPduRyImPCKqiCuuSU/kGARLlyI17iHOOLgQkFnZviLHAoJaSGFq2Bbo154Gtgm4ZM8n j2wN72ty8TLLsH+wwpQDBzHIA+rVHh0KDC7S3x+YR1OURdBDs0d85QFqaS2jdFx4KXevj2bs0jE7+ p265rVG6t49HWYRunLUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuXZZ-00000002Psj-3yar; Fri, 05 Sep 2025 14:37:53 +0000 Received: from mgamail.intel.com ([192.198.163.18]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uuUUg-00000001LXK-3LGP; Fri, 05 Sep 2025 11:20:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1757071238; x=1788607238; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=OGmWrJpLcXWxy4kOfWzDwFhNHI5GSrj775waIjsWVsQ=; b=mu8iP+kKOdOh1bp+ME67lvu4Z3aFofh/qyxdOD6evl8QZFZMPh3QxdGS hHPBfLCvvu5x1iEzLQHUjpPdoBDsZdAHyadhqIQhgsVvVYVuYAwvOmIFa fMdryFygR0er+QMCEqQBCtz4SqNvdz8vYv+OJykGTbTLVV5zP42wK+/yt UVIDlGU730+PECa+zoN/i3K+nmSQ7NRBt074+2vNTCU03rYAuNSqCMYOU xgbPH74WKteNqzuW45VdkRK9xvgnF0xOOsvDptA0mmz3CrYUEZK8x5I9z yQli0Vklc5G1zBYDF4yJug2yW8FKLrdZVWb2VxdH/1JRRWDmsiEPlwceo g==; X-CSE-ConnectionGUID: NFsalROVR9SJJh5v8CqjSQ== X-CSE-MsgGUID: ENODATXLSOSVmplO05y/gg== X-IronPort-AV: E=McAfee;i="6800,10657,11543"; a="58633164" X-IronPort-AV: E=Sophos;i="6.18,241,1751266800"; d="scan'208";a="58633164" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Sep 2025 04:20:33 -0700 X-CSE-ConnectionGUID: cvFrgh+1Q/O8gYdxESH4AA== X-CSE-MsgGUID: EfmsnKDwRvajVzhRnqz99Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,241,1751266800"; d="scan'208";a="177380651" Received: from kuha.fi.intel.com ([10.237.72.152]) by orviesa005.jf.intel.com with SMTP; 05 Sep 2025 04:20:27 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 05 Sep 2025 14:20:26 +0300 Date: Fri, 5 Sep 2025 14:20:26 +0300 From: Heikki Krogerus To: Sven Peter Cc: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felipe Balbi , Janne Grunau , Alyssa Rosenzweig , Neal Gompa , Vinod Koul , Kishon Vijay Abraham I , Thinh Nguyen , Philipp Zabel , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org Subject: Re: [PATCH RFC 14/22] usb: typec: tipd: Register DisplayPort and Thunderbolt altmodes for cd321x Message-ID: References: <20250821-atcphy-6-17-v1-0-172beda182b8@kernel.org> <20250821-atcphy-6-17-v1-14-172beda182b8@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20250821-atcphy-6-17-v1-14-172beda182b8@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250905_042038_846341_98B9A1F2 X-CRM114-Status: UNSURE ( 8.15 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org > +static void > +cd321x_unregister_port(struct tps6598x *tps) > +{ > + struct cd321x *cd321x = container_of(tps, struct cd321x, tps); > + > + if (cd321x->port_altmode_dp) > + typec_unregister_altmode(cd321x->port_altmode_dp); > + if (cd321x->port_altmode_tbt) > + typec_unregister_altmode(cd321x->port_altmode_tbt); You can call typec_unregister_altmode() unconditionally here - it's NULL safe. thanks, > + cd321x->port_altmode_dp = NULL; > + cd321x->port_altmode_tbt = NULL; > + typec_unregister_port(tps->port); > +} -- heikki -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy