Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp140848lqb; Thu, 23 May 2024 13:19:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWYWUQxEI5MxOIDgL3MfZOs0MDDAHe/UFpcJey2RW6Pc+Y6NjTVuBGYsi67LSlPfpc53fwJ0iCGFDCJlPslTjaIVKJcs0Hf4VHvaL33mQ== X-Google-Smtp-Source: AGHT+IFUA1YSFqDHUHYHR8qIWH1FsHqzDyDthizLKVudN7b09DwOyzntUdmbQfbK24DXceoHzKOC X-Received: by 2002:a0d:e687:0:b0:618:5b27:e12b with SMTP id 00721157ae682-62a08d5db1dmr2547477b3.7.1716495553668; Thu, 23 May 2024 13:19:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716495553; cv=pass; d=google.com; s=arc-20160816; b=ef5G1XBcetiYWCvwAuxbQ513nr3xw+DHjgemzkzJziOiPL4eire2uCVkLcUJgd89iy 0DtcKKqUewzPE4y7cfsB5H2YenU/7+QFPVVDEMiHG/ey9qoDWTh0/clNi5n/7VNq3tBT kf7C5a0G/B4JVcGfY5vhPvcJ5rNdAKbtOzo9vS1FNcSHQSTkyrS0dxYkNWnyi1GY6sgB VW9OgkEqS1YHgC2uRCTeWny4zTgcln4B9A/4PQOnCWkcwQGi/DMhkgj64KBeNxSABj0i Tln6Hq8Dw61x4C7CEg74rMRJCrqJfKpfmi968SaxsNFgDFeyddIUoJk7wwasr0AFcuO0 m4/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=b6Wt/yr5KVLoM5TaMmIZdJgpIFHqeGyswfXtkHFJYik=; fh=NCSKnKOg42/wkGFTwNfp9OciJZJqBmowbrke9ICC2nE=; b=TE5re1IBNL1/HzOC8ag/NKNFE5308XZuI31Pj1Y8o1jxx8HwJUgp5fdGfd40D/38iw JNM3yxo3K6vHESnqc6WC4XL5Cr93lDYPoTbiu5kYri59jBW9+H7QiaMlC4yPTLraNCvl RAmHH+Pbrv1+jtuwHtjXQXp6vKhdPdxtGuCIXVCYoUoSikEfVIEOkfB/mXV1tbmRKt/o thzITcYzeFHPNf0jbzGmlHoszFHr45NOZc6CCNcyTRKR5ltNf6HLEEOmUBvQRsnUwUOM GCcpiOKX0j+QPH2dgr3zqZhTI0nUUCl0ub3slv0nNJM+ZfcKMov6SzuFUrWJLfDE2ji7 aqAQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gaTRJS5V; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-187961-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187961-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac110522e8si285496d6.338.2024.05.23.13.19.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 13:19:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187961-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=gaTRJS5V; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-187961-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187961-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4AA571C21616 for ; Thu, 23 May 2024 20:19:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 114FD84DFB; Thu, 23 May 2024 20:18:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="gaTRJS5V" Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 BF9E2823AF for ; Thu, 23 May 2024 20:18:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716495535; cv=none; b=CH7So7+0fV5bUJDSo0Ij13TpoiZuE0FAzo4oZQetYahScFpYhaE8+oB2ZZBIgpNUOcRvQ6FW8IXTpT242i2mYPePp4sJlPo5eIv+1hjPXBZ6MyYvceP9JJ+2X4XP6XPhA+Ef87nbakGA/WUNdZecIRF7WmRxUhjrwK7YJONgpm8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716495535; c=relaxed/simple; bh=/MnKLO3shXWEZFBIMAsNwFyC317yrwWObfqwNCUloow=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hNLKkNdhijCEkyPhE8cPJquB0dmP4LaY5p8EoQWN6wDLhvADjG81vMJgOVSF3Y/jnKhdcaFyArh3a47NeXS/hXqOEwZnFrlzHYsURTg1aYUTvitlP64swVenhmrb98vlQZ/a//aucNLSQdz0kn6JJwyjXnX+uydJjDHu2WjKNRo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=gaTRJS5V; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: markus.elfring@web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716495529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b6Wt/yr5KVLoM5TaMmIZdJgpIFHqeGyswfXtkHFJYik=; b=gaTRJS5V2i8CsvTKTxwRH7Eml035EyZJldaxir3Sy+sotgCbBJPtXmN/qy9ArbajrCZDTT JOBGcTzNEuizdoJjis4+R4rfFC2+2MVjzOGuQokAaLayUNBE4c+kNtnozpyW7q24rOveS4 lOld6QJrNva6uNYLTJQSyuQdjTJv25g= X-Envelope-To: linux-arm-kernel@lists.infradead.org X-Envelope-To: linux-pci@vger.kernel.org X-Envelope-To: kw@linux.com X-Envelope-To: lpieralisi@kernel.org X-Envelope-To: robh@kernel.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: bharat.kumar.gogada@xilinx.com X-Envelope-To: bhelgaas@google.com X-Envelope-To: lorenzo.pieralisi@arm.com X-Envelope-To: michal.simek@amd.com X-Envelope-To: michal.simek@xilinx.com X-Envelope-To: thippeswamy.havalige@amd.com Message-ID: Date: Thu, 23 May 2024 16:18:42 -0400 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v3 5/7] PCI: xilinx-nwl: Clean up clock on probe failure/removal To: Markus Elfring , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Lorenzo Pieralisi , Rob Herring Cc: LKML , Bharat Kumar Gogada , Bjorn Helgaas , Lorenzo Pieralisi , Michal Simek , Michal Simek , Thippeswamy Havalige References: <20240520145402.2526481-6-sean.anderson@linux.dev> <4a43cda4-dfa4-4156-b616-75e740f6fd64@web.de> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sean Anderson In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 5/23/24 16:11, Markus Elfring wrote: >>> … >>>> +++ b/drivers/pci/controller/pcie-xilinx-nwl.c >>> … >>>> @@ -817,11 +818,23 @@ static int nwl_pcie_probe(struct platform_device *pdev) >>>> err = nwl_pcie_enable_msi(pcie); >>>> if (err < 0) { >>>> dev_err(dev, "failed to enable MSI support: %d\n", err); >>>> - return err; >>>> + goto err_clk; >>>> } >>>> } >>>> >>>> - return pci_host_probe(bridge); >>>> + err = pci_host_probe(bridge); >>>> + >>>> +err_clk: >>>> + if (err) >>>> + clk_disable_unprepare(pcie->clk); >>> >>> I suggest to use the label “disable_unprepare_clock” directly before this function call >>> (in the if branch) so that a duplicate check would be avoided after some error cases. >> >> Well if you want to avoid a check, we can just do >> >> err = pci_host_probe(bridge); >> if (!err) >> return 0; >> >> err_clk: >> ... > > This design variant can also be reasonable. > > Do any preferences matter here for label name selections? Personally, I prefer to use labels named after what they're cleaning up and not what they're doing. --Sean