Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp455941lqp; Mon, 10 Jun 2024 09:02:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbI/hIJraLmRDq7H5YV63XEmTgC/pRx2lVf8oOR8yiWse2kzf5/wSHCMc1axwDg/JEdPtswHRfvwsXHDnZfMlRuUXGgxet1uUCCfq+Mg== X-Google-Smtp-Source: AGHT+IEN9FlmUhXeeu/UGfDw86XVN3LoL0+tRORgzWBri4jtN27PQniK5vw3vvBplROUrpeXGaMN X-Received: by 2002:a17:906:f9c4:b0:a59:9da0:cc1 with SMTP id a640c23a62f3a-a6cdaa04d22mr760835066b.58.1718035375502; Mon, 10 Jun 2024 09:02:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718035375; cv=pass; d=google.com; s=arc-20160816; b=e8Bmmd6zLBPPytUNB+bgfe0PsxkuF1cP4GAASskUXpIAQ2LGPZgUxPBo9BSfTcUjIs ISCg9hn0/h4MMOpYnJ4SqUDpsycFU/i+ozA2CA+i9928y9wkuXr7sRMy4XIhtMXn/qun bs6X8aj6EtJDhNz+G02FdWaAbHgAiJ5PgRvYS0F1yMy/mtaVTnXaazH+JsiQLmD4/lnO ZTz4Iru+l+JKl5pBL/JxwrmeWDFn1lMUFWFzRWPJV5Z3SP4aq7iCHYx2L1MJcvYDoTZp l1oq4UsfGm4SfK+TXZMAWi78fcyhngMgEK54d6TlSYjJDt9IhCLQoIT6CtaJHj17BoW4 +XSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=T5ORgJyqY+AMpTaah8V6mIBBt4h137AbV3jzOZG5HN4=; fh=eviwoqtGBAjzp68LJEwaC6qudE0d0/Dqr9VLcxAaBZA=; b=qfJW3p67d3j4m+l0FcIkj/75mne7qKh8B23CQ8MOwgRi/Ih+i1sljJr7cNWFtpE40n RF5ny/T41q1vr2OxBbgKWCCoZTiqJN/+fhpeEbPgFPmOorSVbB9WQH4DrFrU26KKHRIL RXZSMCvXszGBnmCm7SFNscSo+ZNn8T7ngM1EHl5V5BUTt+czpXStoG+kVIOm1/EG+MOP FZX/nS+o+3Arp8G9CLQlwKPfvEcw5Az7XpSZwoeQVUhbNl5BF0p9oTWEcDsV1AGWpDwz tM677OSQSksE0NgXfLCZkPOmFgwWVXm6EYbpCIN8MQumdq18PA0En+4sw5xxyRZSv5xU GZkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iy9X2o9C; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-208206-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208206-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57c6de22c68si2534390a12.584.2024.06.10.09.02.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 09:02:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208206-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=iy9X2o9C; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-208206-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208206-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E264C1F227CB for ; Mon, 10 Jun 2024 13:03:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 917F4824A1; Mon, 10 Jun 2024 13:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iy9X2o9C" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 673CB823A3; Mon, 10 Jun 2024 13:02:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718024570; cv=none; b=M/lDc+Ux5WBWnhBJ5c7NBVFwBBym8L01GTpAUDngQh8ggR2jooo5betxsFix/1pwudOwJ3G06ALJyKhmnTSEIOCQBfQaQHhmVh13LhXL1h+Wvos9DbUETBepoMM/+mtFhGgpAxtcat0wg6GnvcikosEhPvxzUfHcBhrJZ34nvjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718024570; c=relaxed/simple; bh=p7sK+lWKq/e0CGwf5/tnpChLf3M+KMSWrSTB9SN8IkA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ahMxJxSKXH5JBCzCwrLyoEp2JCiUR2jEdPcH+y1JIa6qIZjANiIdXY9P2C47uGaDIf8S00jMhCcx1WRkPwEqVzP/EyaFW1bWEarTPDTygXJvRPmDWzhooBW0cWzLrJmQyuuH+tju1NeYLUrjd6DGmM8psGqlzm7F1irZG+Eig9s= 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=iy9X2o9C; arc=none smtp.client-ip=198.175.65.12 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718024569; x=1749560569; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=p7sK+lWKq/e0CGwf5/tnpChLf3M+KMSWrSTB9SN8IkA=; b=iy9X2o9Cr8xRSJ7y1cy2KM9UIXJwgfDOLOV1NJmCVWnZkuFeNPN3Jyu5 dR9UROPqhpKo/W0yLt8CxmENouA4QYcPM4da16t0UG246FIr3Cv2DBAdp eVdPgngVeZB+hHW0L8cxfxt2TTFNQu5uNa1HIVuxqIiH6XwTsZQHlu9LK eFEu9zz1L9JlfUNjTmCY7S3Ywda4RHRLW0VvVnven/exTimrtGO5GNBs0 q/vs4xVwzeA9K/mD9Heo70BMDD+d9nAp3Hvq9ZeWJENuzp9LOnnugxkFD 2HY5gZUdFWHulQ1x4Dt7LPPZ/LZdFldk5xQ1XIQx0taboCl6Sohr8kOSr A==; X-CSE-ConnectionGUID: SzFBeSPmS6CA6QJUH04wcA== X-CSE-MsgGUID: uX7vODkpT8OfASAKp6cLLw== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="26094316" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="26094316" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 06:02:49 -0700 X-CSE-ConnectionGUID: y2UqLu/4QO6CVC/YWRKhlQ== X-CSE-MsgGUID: U6GayEYRQe2D0cKllcktdQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="76510597" Received: from kuha.fi.intel.com ([10.237.72.185]) by orviesa001.jf.intel.com with SMTP; 10 Jun 2024 06:02:46 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 10 Jun 2024 16:02:45 +0300 Date: Mon, 10 Jun 2024 16:02:45 +0300 From: Heikki Krogerus To: Neil Armstrong Cc: Greg Kroah-Hartman , Bjorn Andersson , Luca Weiss , linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/4] usb: typec-mux: nb7vpq904m: unregister typec switch on probe error and remove Message-ID: References: <20240606-topic-sm8x50-upstream-retimer-broadcast-mode-v2-0-c6f6eae479c3@linaro.org> <20240606-topic-sm8x50-upstream-retimer-broadcast-mode-v2-2-c6f6eae479c3@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240606-topic-sm8x50-upstream-retimer-broadcast-mode-v2-2-c6f6eae479c3@linaro.org> On Thu, Jun 06, 2024 at 03:11:14PM +0200, Neil Armstrong wrote: > Add the missing call to typec_switch_put() when probe fails and > the nb7vpq904m_remove() call is called. > > Fixes: 348359e7c232 ("usb: typec: nb7vpq904m: Add an error handling path in nb7vpq904m_probe()") > Signed-off-by: Neil Armstrong Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/mux/nb7vpq904m.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/mux/nb7vpq904m.c b/drivers/usb/typec/mux/nb7vpq904m.c > index ed93194b16cf..569f1162ee2e 100644 > --- a/drivers/usb/typec/mux/nb7vpq904m.c > +++ b/drivers/usb/typec/mux/nb7vpq904m.c > @@ -415,7 +415,7 @@ static int nb7vpq904m_probe(struct i2c_client *client) > > ret = nb7vpq904m_parse_data_lanes_mapping(nb7); > if (ret) > - return ret; > + goto err_switch_put; > > ret = regulator_enable(nb7->vcc_supply); > if (ret) > @@ -458,6 +458,9 @@ static int nb7vpq904m_probe(struct i2c_client *client) > gpiod_set_value(nb7->enable_gpio, 0); > regulator_disable(nb7->vcc_supply); > > +err_switch_put: > + typec_switch_put(nb7->typec_switch); > + > return ret; > } > > @@ -471,6 +474,8 @@ static void nb7vpq904m_remove(struct i2c_client *client) > gpiod_set_value(nb7->enable_gpio, 0); > > regulator_disable(nb7->vcc_supply); > + > + typec_switch_put(nb7->typec_switch); > } > > static const struct i2c_device_id nb7vpq904m_table[] = { > > -- > 2.34.1 -- heikki