[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLrHemVPCTjwI8dk@kuha.fi.intel.com>
Date: Fri, 5 Sep 2025 14:20:26 +0300
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Sven Peter <sven@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Felipe Balbi <balbi@...nel.org>,
Janne Grunau <j@...nau.net>,
Alyssa Rosenzweig <alyssa@...enzweig.io>,
Neal Gompa <neal@...pa.dev>, Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
Philipp Zabel <p.zabel@...gutronix.de>, linux-usb@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
asahi@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
linux-phy@...ts.infradead.org
Subject: Re: [PATCH RFC 14/22] usb: typec: tipd: Register DisplayPort and
Thunderbolt altmodes for cd321x
> +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
Powered by blists - more mailing lists