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 77C2BCF31B9 for ; Wed, 2 Oct 2024 20:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=DakEUn7nVCLHNYL1ypHU3lUhhzc9MJa4YEpdXJmqtec=; b=fsnU0bDCsr/3py vKN2frItNizB47L/CJ1VdQuZUsBRKnnHusr59U7nQ7rzwVcJ50RTIQ2Hm1ZvSOtHfQ68BuTIBFLXY LPeJ/G5ZCyuU07ZTI/uQ2n+yw3wGpWCCTTX/tIbQoARii8gHTWywA7GgONGjjsNw45Mki9OYuf3A6 Nkc62tn/WyqJiO7HvXPPBMTk64TsobPtwPyOrfmkUGcFwhgr1i0mnRCUrAoALhMoGcTz7K+BAFSQg of433DXsTu9A5v6qlo2Upn08lDVswPje5FZkkPbKvTK0dCstjKbXwRLRStIX6RE2GxgaF+18o4xA4 Sm5djKcssIO93PsArYyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sw65X-00000007PrU-0Wnl; Wed, 02 Oct 2024 20:36:47 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sw64H-00000007Pg2-47nZ for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2024 20:35:31 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 565F95C371C; Wed, 2 Oct 2024 20:35:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBD80C4CEC2; Wed, 2 Oct 2024 20:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727901329; bh=MqydiT4BUeVyD3/c1YaamI8hpviv3bNgpn4gjmHO6wI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=NOIVTvLJKgk2utuCb21BMAdgbdQSNVfRsUZGCGDbaFfs3S3EKM2Nyyfy7T+AXCccX tcV55OhEEgL/IbrkluD5WDxHF0lSFVZwfqrRABUfPLPvTJV+9hMD9lfHLFyUtZEHNM 7dgkA5iPfWfe5cIBxxc2jaVQzE/+1t8ihJRFx9O2pJmw0aTzBQrc3EqbT/vAjakMKF P/2wYgnkiuRoZ21K1Fye3IUqXfMxiLBHM9gN4srAVvjIfoFQzEMcO28FKjE0BGY4eb 18vmqPMO62rJt2b59T/nMCjcrAnWbml1tJnz0/sVQXT9W1qXS7HV9v2hCxt+xwP9IM JwVpzq+SF8xxQ== Date: Wed, 2 Oct 2024 15:35:26 -0500 From: Bjorn Helgaas To: Riyan Dhiman Cc: vigneshr@ti.com, s-vadapalli@ti.com, lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com, kishon@kernel.org, linux-omap@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI: dra7xx: Added error handling in probe function when devm_phy_get() fails Message-ID: <20241002203526.GA269499@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241001105717.4566-2-riyandhiman14@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_133530_085361_5D609475 X-CRM114-Status: GOOD ( 20.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Oct 01, 2024 at 04:27:18PM +0530, Riyan Dhiman wrote: > While creation of device link, if devm_phy_get() function fails then it > directly returns PTR_ERR without any cleanup of previous added device > links. > > Added goto statement to handle the cleanup of already added device links. > > Fixes: 7a4db656a635 (PCI: dra7xx: Create functional dependency between > PCIe and PHY) > Signed-off-by: Riyan Dhiman No need to repost for this, but when applying, please s/Added/Add/ in subject and commit log (I mentioned this before for the v1 posting). Also add statement in commit log about what the patch does (currently it only says what the problem is). And join Fixes: into a single line without a newline in the middle. > --- > v2: resend when tree is open and reformat commit message > > drivers/pci/controller/dwc/pci-dra7xx.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c > index 4fe3b0cb72ec..c329d107b811 100644 > --- a/drivers/pci/controller/dwc/pci-dra7xx.c > +++ b/drivers/pci/controller/dwc/pci-dra7xx.c > @@ -762,8 +762,10 @@ static int dra7xx_pcie_probe(struct platform_device *pdev) > for (i = 0; i < phy_count; i++) { > snprintf(name, sizeof(name), "pcie-phy%d", i); > phy[i] = devm_phy_get(dev, name); > - if (IS_ERR(phy[i])) > - return PTR_ERR(phy[i]); > + if (IS_ERR(phy[i])) { > + ret = PTR_ERR(phy[i]); > + goto err_link; > + } > > link[i] = device_link_add(dev, &phy[i]->dev, DL_FLAG_STATELESS); > if (!link[i]) { > -- > 2.46.1 >