Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3394705ybp; Sun, 6 Oct 2019 11:00:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRxmfzEbQQ63b0aVsG+Af0UAbCe5VwKjggsJNyucxVwtVMXSi+ZCXPvQTnVNsZ18ICaDGb X-Received: by 2002:a50:b6a8:: with SMTP id d37mr25607977ede.63.1570384804526; Sun, 06 Oct 2019 11:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384804; cv=none; d=google.com; s=arc-20160816; b=cccXQ9OvV1490VO9ObVLPZkQjvbcO4ncEs/lHY+gGBOsxJp70nNlvm9wkCTZWXcX0S Dul9DbOi/vfvIWKR+15m3zLTVo4p9B/Nve8L00u6hUHgwaWNyrBHUtWnc61sU6B0j2Ii S/cJLZG9otRVOsxiv+qgjA5gs2TCfHcFZFhIdnQlHO2l+o1pODnT04m7iusaHvCbf9na 5I7UPMn//jRUaFBDM3mttkZsZba+gcOF45oGSyWArj1R/Vk/N86G2o/4IUKhetOI/XvO US8PfcuvFZVkYgwxBfCI2CwmmCPlzrKuEescr1pRQZXB/lZ50flFBbwuVZ+THyiLfYSf tDxg== 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=W9E8cHK+dtDOz3q9GXph6dR2ZOZWs1aIsB0jUGG8ehbtq+TtyHyUpch79mZaIWRimP JSHYNzObMQmBOe8a2dVQ2KKIxH4hDTIvKuStlG6xTaERxB3hgHZaAUqAyWyacvXLzH25 ILnD8KMIGX4vHxSMfnrJYMN4OCnIp0hjsnAod3/SA5L/A5JrheBn3keT1gg0MZaz327G gNkxf5bD/857eQK7IOi4810IlKZPzae8fCFtOdC66J7frsg5SEpqHU0PsaOcsYylgo9M vxqKwqJz2Zx//UR0kWN2hUlNYs/SW5+Ody0qHOgkRuDwSQ9VpUJpk9Sd3kWx3WCTwo4K kqZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ltzuFaAT; 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 l18si5751245ejg.248.2019.10.06.10.59.40; Sun, 06 Oct 2019 11:00:04 -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=ltzuFaAT; 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 S1729284AbfJFRap (ORCPT + 99 others); Sun, 6 Oct 2019 13:30:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:56666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728207AbfJFRal (ORCPT ); Sun, 6 Oct 2019 13:30:41 -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 3EF6D2173B; Sun, 6 Oct 2019 17:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383040; bh=fmz5hC3yBNgy6dgTbMASSrGRRvVOVbS1qhdGVdbjLH0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ltzuFaATQuU8uMFgVy1ynuuQJAetMuhDkdyO8MZOIXgbLAz5iipNJ1AWyrGYPezRj ySayWKqvzg0Z9stq3eKvBMO7u/aIR48NyLfM+4M5MzSCSyDmkIIfAsgT+SWhP65krG nEYADSfL4BHJmvME32x7dzqHekSSoNpA3l4rzcVk= 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 4.19 064/106] PCI: exynos: Propagate errors for optional PHYs Date: Sun, 6 Oct 2019 19:21:10 +0200 Message-Id: <20191006171150.757811783@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171124.641144086@linuxfoundation.org> References: <20191006171124.641144086@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