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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA241C4360C for ; Sun, 29 Sep 2019 17:42:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BDC9C21835 for ; Sun, 29 Sep 2019 17:42:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569778965; bh=fmz5hC3yBNgy6dgTbMASSrGRRvVOVbS1qhdGVdbjLH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=lD6xihQdi9oC1Y28JaV8dmA7TYYB0RkYJormyivo6ze0CdnK4Q1XBud4mLuRQxmsj 4wm1ydhjLx18A6kge7oKDpUV5pquQQRD6NucoZIMi8XCQYkDo2Ks3eEN+6Z9+ho1Cx 86LeI1SmsHBEmefTUsw2Ny3EApxakUPT/73i0Ik8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729545AbfI2Rb4 (ORCPT ); Sun, 29 Sep 2019 13:31:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:42504 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729518AbfI2Rby (ORCPT ); Sun, 29 Sep 2019 13:31:54 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B0A3421925; Sun, 29 Sep 2019 17:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569778313; bh=fmz5hC3yBNgy6dgTbMASSrGRRvVOVbS1qhdGVdbjLH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w/gIGKn+Udn7cPkhPrlW6jyYfE5dVcHg4/DRmcG2h8ShQ5JmsD5UTGPg3pGuEL3u+ Qmy5PSSWKY3Jfi/jUEeNdUrDh9iVgMftL8PQvh2Fx3L5m43qld4wduZpf0ARx6Wz1/ Qg3GV5d6QJNa6CX+737VLQRtOYv/hkuT12VymCi4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thierry Reding , Lorenzo Pieralisi , Andrew Murray , Jingoo Han , Kukjin Kim , Krzysztof Kozlowski , Sasha Levin , linux-pci@vger.kernel.org Subject: [PATCH AUTOSEL 5.3 30/49] PCI: exynos: Propagate errors for optional PHYs Date: Sun, 29 Sep 2019 13:30:30 -0400 Message-Id: <20190929173053.8400-30-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190929173053.8400-1-sashal@kernel.org> References: <20190929173053.8400-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thierry Reding [ Upstream commit ddd6960087d4b45759434146d681a94bbb1c54ad ] devm_of_phy_get() can fail for a number of reasons besides probe deferral. It can for example return -ENOMEM if it runs out of memory as it tries to allocate devres structures. Propagating only -EPROBE_DEFER is problematic because it results in these legitimately fatal errors being treated as "PHY not specified in DT". What we really want is to ignore the optional PHYs only if they have not been specified in DT. devm_of_phy_get() returns -ENODEV in this case, so that's the special case that we need to handle. So we propagate all errors, except -ENODEV, so that real failures will still cause the driver to fail probe. Signed-off-by: Thierry Reding Signed-off-by: Lorenzo Pieralisi Reviewed-by: Andrew Murray Cc: Jingoo Han Cc: Kukjin Kim Cc: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- drivers/pci/controller/dwc/pci-exynos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c index cee5f2f590e2d..14a6ba4067fbe 100644 --- a/drivers/pci/controller/dwc/pci-exynos.c +++ b/drivers/pci/controller/dwc/pci-exynos.c @@ -465,7 +465,7 @@ static int __init exynos_pcie_probe(struct platform_device *pdev) ep->phy = devm_of_phy_get(dev, np, NULL); if (IS_ERR(ep->phy)) { - if (PTR_ERR(ep->phy) == -EPROBE_DEFER) + if (PTR_ERR(ep->phy) != -ENODEV) return PTR_ERR(ep->phy); ep->phy = NULL; -- 2.20.1