Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp451334pxb; Thu, 9 Sep 2021 04:55:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAyIuQA4QUckkH3J8siESYlVSGJ0Soa8f3mpw5D2vHQ33GkQfcj4Z6iCeP4WMKZNe3jhWd X-Received: by 2002:a17:906:7154:: with SMTP id z20mr2960485ejj.547.1631188500404; Thu, 09 Sep 2021 04:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188500; cv=none; d=google.com; s=arc-20160816; b=ilSYZhMf/NWWXSHqxhg0fxwAZn4Ld1C/+tEuEjNQ+6LeGLvNqN5ThqS6d/d+KiB3qU +8oCSW2wQK5jgIzRiJEpeofN2pJZG3h4//nmz6Vw2icJ4tNDiM2hr+d7/Cy/Juj6Dcqc Q7J1yyHMzYHO4USbLP2vbhewXXpzaTdM+PVIJuHDUSGOb3+WlMaV9fBHNaUI2i8Ri0lR /G08/KIsl0ZrcvdkY195hW4gMDwxKGbm0q5w+jWOM0tpK+xS44pyf9zhQcx/xVmZhElh f7e/9AVSsY28tT61fE7Yjjeo9xVoDmBhe5+WdGwbohijBdiJtBl8xUrWnQHFUakzpLkA /+Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uLANQ0IiDqBwFKV1m23ixkdwpujPV2olOHIL6sDEAbo=; b=x/LxdODwoP0gntb/sRxlYBv2zgBe8NeTdAYY+t1dL5bJb5cuZNwNWY1LI5I80byfWG YBtObQrieS5Txa4a5i7XZSxXj6VtCeqn8pK8/EATVlEWBM8DXevS8+n5iDKPpGkhRn1Q RJbtacGWRQIG0DJlG4HjktvL7yG3RaLeCUbH6EXNc61HpXi086PqncXAx+kxp69ybLxO jbsV6aJDWA9ykWP4ax3AGkJ4BoDqnILhsci+jyHtFC/I1xUSyE756aiQ4Arik9+kZkEs kHRz6YoMRjNTrzBHrRTpysiwnNvZWapxhsx0/uevKGmhv5RZ3mfepUH/qBK2TloJEZqO Pa0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LrV0x7MA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js2si1812670ejc.576.2021.09.09.04.54.36; Thu, 09 Sep 2021 04:55:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LrV0x7MA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240773AbhIILvF (ORCPT + 99 others); Thu, 9 Sep 2021 07:51:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:46486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240926AbhIILqa (ORCPT ); Thu, 9 Sep 2021 07:46:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6F286124C; Thu, 9 Sep 2021 11:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187777; bh=0SQO3dsOesV/b1l38s4e7bxFqHBn1nCeqqbt7vgjWlU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LrV0x7MAwV1BG6sAiQWpHyvEcm0n75rXUedL5QM0JbS39IIawhlrYi/oV8f6psC2j 8TtolSFdbFrrkc5FlT6KDDrqcF+zV5Pe7gGPECNdXV4997wMKwpfaPMRI2c7Z5a2h9 ttF2WgK9R+QAq0fI9WetV8YfId9oKoxtuKkXrGDys5Al6hLLxyqehJlCzJJIrQiQZu 8EF6Q68HuT1Se2P0i0Qy4szM+NbJbPMuKMl2m0yrEOui5d7x+cxkjJcXr6UcFg3v0J lpZH0kUeUE+4hPv8bIhIIkJRqwD41U4XbGkivkntCvfwn+ynxuBS7D4yFog5VfU6Fr NrCLqvcK2Kkpw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andy Shevchenko , Jens Axboe , Sasha Levin , linux-ide@vger.kernel.org Subject: [PATCH AUTOSEL 5.14 087/252] ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init() Date: Thu, 9 Sep 2021 07:38:21 -0400 Message-Id: <20210909114106.141462-87-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit 3ad4a31620355358316fa08fcfab37b9d6c33347 ] Last change to device managed APIs cleaned up error path to simple phy_exit() call, which in some cases has been executed with NULL parameter. This per se is not a problem, but rather logical misconception: no need to free resource when it's for sure has not been allocated yet. Fix the driver accordingly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210727125130.19977-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/ata/sata_dwc_460ex.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index f0ef844428bb..338c2e50f759 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -1259,24 +1259,20 @@ static int sata_dwc_probe(struct platform_device *ofdev) irq = irq_of_parse_and_map(np, 0); if (irq == NO_IRQ) { dev_err(&ofdev->dev, "no SATA DMA irq\n"); - err = -ENODEV; - goto error_out; + return -ENODEV; } #ifdef CONFIG_SATA_DWC_OLD_DMA if (!of_find_property(np, "dmas", NULL)) { err = sata_dwc_dma_init_old(ofdev, hsdev); if (err) - goto error_out; + return err; } #endif hsdev->phy = devm_phy_optional_get(hsdev->dev, "sata-phy"); - if (IS_ERR(hsdev->phy)) { - err = PTR_ERR(hsdev->phy); - hsdev->phy = NULL; - goto error_out; - } + if (IS_ERR(hsdev->phy)) + return PTR_ERR(hsdev->phy); err = phy_init(hsdev->phy); if (err) -- 2.30.2