Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3389897ybp; Sun, 6 Oct 2019 10:52:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6e/HFy2dB0gdZkOWLBdsHh9fLcOzPW+uXTY776jJUC0ilai7Yw5dbtBS/8SFZB/ipYotr X-Received: by 2002:a50:9eee:: with SMTP id a101mr25241927edf.128.1570384357176; Sun, 06 Oct 2019 10:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384357; cv=none; d=google.com; s=arc-20160816; b=cEOizvV1rghX6/JHhxBa/dj9IIqkSCuEwfuzan9mY/oV8wWQsf1w50X+ivePn4xbgC 75oDcRxJE2xAf1C7pyGz36WIai4wToc4/7K0uLbgusEDOQ8BEsag+gcrC5Petp4gerz3 hLg7QNqCzIRmYTgxPub8Bq0VVDKZqdkC4LkqKgVbwGttGsJZsIcu19r3qWux+G1wkq+L bKJJBWdje06EKFDkwy7AAVFNH5FMxxf75qpvpp6jsITPsenQ0drWmt7xVOoMLT5Z3o5e Uz2cjOfnwR4BgJRixi/auwjoJh2Sx+KBrVrvCa6/mUz+c17j0RiFKwZBqcIMOubPbIGN D3/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H+zwdb89LIhqjtMa8knBR4C+qxB/3MrohdQeEzrA3GU=; b=UH7LPgTtrdR3oRHIQp/nQZcp7HjW0PD6dODacALoUkc6qNmp1ko6xPO6UaKEvepd3m gDt1B/OZeUdzgxuUdyQXEhbEIurzJXvflTZKepcP3Zlkj+TsTzgj7z4UD4YsjIKzxrXI wAd3XjQWI2sf3TQ2n208yyeYpt76CkXObZBCT2gXMMKI5zJUbIMs/Q+78ocVfrF3fxWu 1yOa9+JpWBO7Vi3ZmNueYW3SrSB1djZ4QIdVN9Py3jcdlJ3tuMyZx9Ha26R6vUedBhid WHHBE0sodDFctIrzi74wnMT/ojEqhVt1gXXgbLmVEs6/w06YBcoMujmHk/Fw0pFUR2AH fW/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aLjhtdwq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fk4si6214968ejb.161.2019.10.06.10.52.13; Sun, 06 Oct 2019 10:52:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aLjhtdwq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731569AbfJFRnp (ORCPT + 99 others); Sun, 6 Oct 2019 13:43:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:43736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731564AbfJFRnn (ORCPT ); Sun, 6 Oct 2019 13:43:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9731420700; Sun, 6 Oct 2019 17:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383822; bh=fmz5hC3yBNgy6dgTbMASSrGRRvVOVbS1qhdGVdbjLH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aLjhtdwqltriAJNHvnWXHmawE2LgdlGwELYfWk162JZypztGBkFkygx4Oa8232hTx 9w3JSp9AB6rlkol4x6U+nFzjOmlyVeQNxfUEVe1WZ5hHsx2GDh67CcKIbg89wwhdUX EMYR3u/HZ04iHsyEuqCFC7JYKRoQhV8FgafTD3ps= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thierry Reding , Lorenzo Pieralisi , Andrew Murray , Jingoo Han , Kukjin Kim , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.3 108/166] PCI: exynos: Propagate errors for optional PHYs Date: Sun, 6 Oct 2019 19:21:14 +0200 Message-Id: <20191006171222.544468920@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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