Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp516702pxb; Thu, 9 Sep 2021 06:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMfh6+p+ud3yptJHDx3+paXTV2Ss01re+OAT/cIVcZbAmnPcD0vSKXWizJLBDUOoRdUwub X-Received: by 2002:a6b:c80f:: with SMTP id y15mr2631514iof.80.1631193389119; Thu, 09 Sep 2021 06:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631193389; cv=none; d=google.com; s=arc-20160816; b=szhyghjw5GyN20waXXi0Da4ak8l19zcwzmzGTfhmoQIZxBGkcaaOiQbpcIi5WzeX0W qW5ywTwD/oA4xUe9eoluEg2V0dCi2QotxoX/xKoKL3vwEMbbeg3w9WimdrhYLp5R55yi OB9jrjd1g9AVKVbQVEu70ufOV8yZlKrviKDdduJ8XqzTiuCrVFc8mh6Okt/2CJPVN5Lu W07KVPUx/dkHZuVhFX7jKY/qtFEVwJWgfiJlY5fsJZR2/6I+YljMnot9Zymj1d10FCQE JoCL9AP6ZVrEjEQ7TlmEdnX0hbYF6kvLk8hYa6dP6EMzk3h37SyXVxlbLpeQF5wRuYPo qTIw== 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=D8ByUMJ2kj+6ybAhABdOdRmTI8ME64SMomlQJIwwhWs=; b=BW5jYVnQ1Cg0+fZ5xUQCqgTBjfjCtXcw5mJ9/qNLuZUiJvRjLITq7wCNAgF4T+u9D1 AHAy9nStT4UkTEtczXzSJgKAoo9eE51sxcmFz19D1mSpxtAz2o4QsCtZKldj8VaopbgY juW67xEpqtRIdzCHjaLEQsE6M6eBxxeNZ3iY1wR1NIFXzsxu55TP1zHHizNNybeT8Pvj tdobIFnXS4zAPIgMVLmzPtk+gV7e9hbLc2v7g8U85GpuJVHovYOADMuqWv7SzrHMGSoR tM2n+qu+pnjCfH4iZX9TL/mcMCVbKYxpymHubtYW5KUqrJekfvYNbS7WE9ZcrNofvJOb 3qdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=R6AgFV9X; 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 13si2124815jan.43.2021.09.09.06.16.14; Thu, 09 Sep 2021 06:16:29 -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=R6AgFV9X; 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 S1355954AbhIINNx (ORCPT + 99 others); Thu, 9 Sep 2021 09:13:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:42490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357670AbhIINDP (ORCPT ); Thu, 9 Sep 2021 09:03:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3BBF563277; Thu, 9 Sep 2021 11:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631188775; bh=eXULAlZ7qapbLcZqOTCZhks1KXeuN+HBLgGlB1Ea9fA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R6AgFV9XvX64SV7Ey4Bg02K8WxEgEHLsbhE4ual5xaIV3/WKO4EOuASzBU4zkUJKl e6NaImYsHltTrF6yPivYFyGVnJRgNEa6HPVT9g4PcRnFEV140xeRwRzaKFz7bFRyco 3A9MMZIrgOpH5YDLJ7a8oMSA8q9v+AuRNR+nVp4bN5yGMatgFSV2pHHPK2q2t07KTm R5GP7grDwWaX5wTraigvTWtiM+MqshXWiw2sT2fJx0yg8keViY4hOuok0GF7HCNPmy h1SeR5oXZ8qiJa9uQu8kIrCcB2xqMlixzIzSb01bTl3MogNlwkUqEldpDVBuBH6shw 391sReolLyFdQ== 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 4.14 28/59] ata: sata_dwc_460ex: No need to call phy_exit() befre phy_init() Date: Thu, 9 Sep 2021 07:58:29 -0400 Message-Id: <20210909115900.149795-28-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909115900.149795-1-sashal@kernel.org> References: <20210909115900.149795-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 ce128d5a6ded..ed301dee200d 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -1253,24 +1253,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