Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp500570lqp; Mon, 10 Jun 2024 10:12:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNfc8colAoJUA0/36/NhAB793H7oMQCpbsZvkryzy0Vem/BLg+EzpBoJoHb/OH385SyorG4H/a/Qsm/d6i8OeoqJOSjEkIwWjPXXCN5w== X-Google-Smtp-Source: AGHT+IEdG1M9UCVI/Y0xqP9ev7HatBlKKE6AgBtub+8RY4tt+CO8LJD9n7WQ/nYJDngFFAMaxwyq X-Received: by 2002:a17:902:f791:b0:1f6:a55:ba0b with SMTP id d9443c01a7336-1f7287925aamr3902335ad.7.1718039562509; Mon, 10 Jun 2024 10:12:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718039562; cv=pass; d=google.com; s=arc-20160816; b=jsiDZEPNn30cZJPRBLOzrxFpo4+iBCBV9Ilqrd0x387LqDTWmSXNbPD4rMreNE6B5T hbFyLRbbcoOPyl9Al0g2jRYCI4rdEPlRX5aRcg95d/K58rQ/x3yZHHVrRmkdTATEhhWV BI37tODN/jB7+OyirHzUohIdOgsJxn3Vr6zWhgBt4XXbAyBPOYi0WYjqmUiITuWxODiq r5mzVVyiSRWPScC0SQfFf8kSXH4O4L/aVfFwJWvowrjxQmojg4DwSaRml0qNhgP4sZP4 AoA28yjaIaCstEz9KX0rvuIgHw79ZjZog9JRIa7dgk438ruWLnd7+GePFR7IEqU5mYMY jCvQ== 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=JcgnsSMTmVkGlV3Fu7//FHfxgtHcRXwtQJCWNHBN0SQ=; fh=eviwoqtGBAjzp68LJEwaC6qudE0d0/Dqr9VLcxAaBZA=; b=DBLl1a2rAxpIE9DaMREp+RBLjld5tO0RLFbzOGsftTDIYTqHuOhSaXTXIsKNt+xXTI b+SDOlMGBuAyA8kbpzUITReThRAwW6ABcSUi27+BsPR05bqJnfSJ07i+HjLX6L7gxg/l VPLzFIC4I0vG2Pxltjbgm5u2z0tCgDsQ3Qzu5Q6js8PIsYBG4mooBo09pLNn4PiVtqhM VpYJA53v3sP+XPRpkSoV0koDAbGHkkUfdgZyaWPMWlGQ961IHXbDMlwJJ4Z6J4iElzOC gpqrzUFru0vvOnpMA6/S7JKho0X87A6r7tYrXE0H+/rRw+2cNtx2rTXmWPL8yCkp1R9u hO4Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KwMomoxz; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-208182-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6f66bb003si38392405ad.409.2024.06.10.10.12.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 10:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208182-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KwMomoxz; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-208182-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208182-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id AFFB62849D9 for ; Mon, 10 Jun 2024 12:51:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D1B1B81734; Mon, 10 Jun 2024 12:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KwMomoxz" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 AEAEF7F48A; Mon, 10 Jun 2024 12:51:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718023887; cv=none; b=shHTA1bRljQ1qcpTBYY7KmjSa6ijNAMV+5+TMinnXQdBmdLanI7jsafE53Zt9UyqgqQM2bYU88Pif6pHJMOF3RIDuNQ/HdcLs8qsX/kLKpCNvCqnXZtzVj0PTbMNBXHt9yRQeOuNCWzR14pkzN2zf+HFyIGvjbH3aQkFNV3vJZc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718023887; c=relaxed/simple; bh=2Fc4pFDCgQPKjxooSwTbGF79zLLOa0fePyJi1yAQFx0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=czXYwqeJ/C4IcGfz8b3FTi9INaFvs+rWQi3nMo7fRTUtMQh1DtPSUMG5TGGNlCQ+3BG2yRcnRENilyPKOzD8XWIYtfzGcTUwke/c40aPSKKQWEwXvxnjFqugApFOpV+6qx7byEvPPhy5MhOGBAaBQCQ5yfP15IjylyVgKjXahJU= 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=KwMomoxz; arc=none smtp.client-ip=198.175.65.17 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=1718023886; x=1749559886; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=2Fc4pFDCgQPKjxooSwTbGF79zLLOa0fePyJi1yAQFx0=; b=KwMomoxzARXnnn/t2EqatXc+93hBBM71iEZYvOyn3nfPfl9yfKpjQd+/ EORh4jzamwDXSzIhVmSeCGgZFutKwYzSN3t9AMmBkH38PXRrhnDvvCklo COc/Qd91nMXyM+OGclBZtNeGw7nnprNdU3Bs3Wb9gOUfGFiW1wG6H/CYD ll9nAsMwb7QKfxAlKBHThuksbG358KPhf7SHtX9UzVD0zh14d7OY1XS+4 iTau2X7Gn783gSunTB79upvg6lBBnKkJPwxEko8fEz+cG0WiAYtO0ONm+ usxZOQ8Uh7jrNeOJ77j0fsJEuBIM5fId6/ypkK6Plf41I/AHBsLTWr9WX w==; X-CSE-ConnectionGUID: zwrAxEDDRgmvE5pYpqtFBg== X-CSE-MsgGUID: Eb7MMUdoTCSO0gzvzgdhpA== X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="14801252" X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="14801252" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 05:51:24 -0700 X-CSE-ConnectionGUID: uyedrw4DQOmhZgnVvDx/Vw== X-CSE-MsgGUID: H2shQeqQSD2K+InfTIl39g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,227,1712646000"; d="scan'208";a="39501218" Received: from kuha.fi.intel.com ([10.237.72.185]) by orviesa006.jf.intel.com with SMTP; 10 Jun 2024 05:51:22 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 10 Jun 2024 15:51:20 +0300 Date: Mon, 10 Jun 2024 15:51:20 +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 1/4] usb: typec-mux: ptn36502: 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-1-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-1-c6f6eae479c3@linaro.org> On Thu, Jun 06, 2024 at 03:11:13PM +0200, Neil Armstrong wrote: > Add the missing call to typec_switch_put() when probe fails and > the ptn36502_remove() call is called. > > Fixes: 8e99dc783648 ("usb: typec: add support for PTN36502 redriver") > Signed-off-by: Neil Armstrong Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/mux/ptn36502.c | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/typec/mux/ptn36502.c b/drivers/usb/typec/mux/ptn36502.c > index 0ec86ef32a87..88136a6d6f31 100644 > --- a/drivers/usb/typec/mux/ptn36502.c > +++ b/drivers/usb/typec/mux/ptn36502.c > @@ -322,8 +322,10 @@ static int ptn36502_probe(struct i2c_client *client) > "Failed to acquire orientation-switch\n"); > > ret = regulator_enable(ptn->vdd18_supply); > - if (ret) > - return dev_err_probe(dev, ret, "Failed to enable vdd18\n"); > + if (ret) { > + ret = dev_err_probe(dev, ret, "Failed to enable vdd18\n"); > + goto err_switch_put; > + } > > ret = ptn36502_detect(ptn); > if (ret) > @@ -363,6 +365,9 @@ static int ptn36502_probe(struct i2c_client *client) > err_disable_regulator: > regulator_disable(ptn->vdd18_supply); > > +err_switch_put: > + typec_switch_put(ptn->typec_switch); > + > return ret; > } > > @@ -374,6 +379,8 @@ static void ptn36502_remove(struct i2c_client *client) > typec_switch_unregister(ptn->sw); > > regulator_disable(ptn->vdd18_supply); > + > + typec_switch_put(ptn->typec_switch); > } > > static const struct i2c_device_id ptn36502_table[] = { > > -- > 2.34.1 -- heikki