From patchwork Tue Aug 4 05:38:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 11699755 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F969913 for ; Tue, 4 Aug 2020 05:43:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 609F5206F6 for ; Tue, 4 Aug 2020 05:43:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tdVK9cUI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 609F5206F6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=K+Pk7FSSltoIq23czDMnZl/t4JgBrKCbx7VTtnXvPeM=; b=tdVK9cUIjt9Kn3sS/gCvxIIZe9 y3VEhz0wFC1FtpGwDhvWMOf7KUfI5Tnp2IHULFCeB2hbr6XC3JJjuBM0bW8ZzNHZ91mPv6C+xVXUG gV30lzuJkZouc+20JZOQNspqV1rIXD1VLat6Vy236NaZfrfeIuwRdBcKFwCgu9bhQx7kB9aVs+tDO 6H/TcEfRbUK39uEDPyIEVU7iRrsxeH3DG8lSKC6pZRfsEP1iOZ2KrrjvFS0LD5zAgoTRdrs1mzZ4K +0RjKP8XYKUV0GyuyjPQyHNG6I9QFh0xDbI6UCE5z3JWaF0qGgh8GPKOExQI9wteUOjxIc611k+Yw mnfbQEHQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2pim-0005Wc-3S; Tue, 04 Aug 2020 05:42:44 +0000 Received: from inva021.nxp.com ([92.121.34.21]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2pij-0005Vz-Ef for linux-arm-kernel@lists.infradead.org; Tue, 04 Aug 2020 05:42:42 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BDA862011A2; Tue, 4 Aug 2020 07:42:39 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 70C75201194; Tue, 4 Aug 2020 07:42:34 +0200 (CEST) Received: from 10.192.242.69 (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id A0D70402DE; Tue, 4 Aug 2020 07:42:27 +0200 (CEST) From: Anson Huang To: hongxing.zhu@nxp.com, l.stach@pengutronix.de, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: imx6: Do not output error message when devm_clk_get() failed with -EPROBE_DEFER Date: Tue, 4 Aug 2020 13:38:01 +0800 Message-Id: <1596519481-28072-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200804_014241_838315_5A71D84B X-CRM114-Status: GOOD ( 10.70 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [92.121.34.21 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-imx@nxp.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org When devm_clk_get() returns -EPROBE_DEFER, i.MX6 PCI driver should NOT print error message, just return -EPROBE_DEFER is enough. Signed-off-by: Anson Huang Reviewed-by: Richard Zhu --- drivers/pci/controller/dwc/pci-imx6.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 4e5c379..ee75d35 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1076,20 +1076,26 @@ static int imx6_pcie_probe(struct platform_device *pdev) /* Fetch clocks */ imx6_pcie->pcie_phy = devm_clk_get(dev, "pcie_phy"); if (IS_ERR(imx6_pcie->pcie_phy)) { - dev_err(dev, "pcie_phy clock source missing or invalid\n"); - return PTR_ERR(imx6_pcie->pcie_phy); + ret = PTR_ERR(imx6_pcie->pcie_phy); + if (ret != -EPROBE_DEFER) + dev_err(dev, "pcie_phy clock source missing or invalid\n"); + return ret; } imx6_pcie->pcie_bus = devm_clk_get(dev, "pcie_bus"); if (IS_ERR(imx6_pcie->pcie_bus)) { - dev_err(dev, "pcie_bus clock source missing or invalid\n"); - return PTR_ERR(imx6_pcie->pcie_bus); + ret = PTR_ERR(imx6_pcie->pcie_bus); + if (ret != -EPROBE_DEFER) + dev_err(dev, "pcie_bus clock source missing or invalid\n"); + return ret; } imx6_pcie->pcie = devm_clk_get(dev, "pcie"); if (IS_ERR(imx6_pcie->pcie)) { - dev_err(dev, "pcie clock source missing or invalid\n"); - return PTR_ERR(imx6_pcie->pcie); + ret = PTR_ERR(imx6_pcie->pcie); + if (ret != -EPROBE_DEFER) + dev_err(dev, "pcie clock source missing or invalid\n"); + return ret; } switch (imx6_pcie->drvdata->variant) { @@ -1097,15 +1103,19 @@ static int imx6_pcie_probe(struct platform_device *pdev) imx6_pcie->pcie_inbound_axi = devm_clk_get(dev, "pcie_inbound_axi"); if (IS_ERR(imx6_pcie->pcie_inbound_axi)) { - dev_err(dev, "pcie_inbound_axi clock missing or invalid\n"); - return PTR_ERR(imx6_pcie->pcie_inbound_axi); + ret = PTR_ERR(imx6_pcie->pcie_inbound_axi); + if (ret != -EPROBE_DEFER) + dev_err(dev, "pcie_inbound_axi clock missing or invalid\n"); + return ret; } break; case IMX8MQ: imx6_pcie->pcie_aux = devm_clk_get(dev, "pcie_aux"); if (IS_ERR(imx6_pcie->pcie_aux)) { - dev_err(dev, "pcie_aux clock source missing or invalid\n"); - return PTR_ERR(imx6_pcie->pcie_aux); + ret = PTR_ERR(imx6_pcie->pcie_aux); + if (ret != -EPROBE_DEFER) + dev_err(dev, "pcie_aux clock source missing or invalid\n"); + return ret; } /* fall through */ case IMX7D: