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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 5B6ACC433E2 for ; Thu, 3 Sep 2020 22:26:55 +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 201D520716 for ; Thu, 3 Sep 2020 22:26:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pXEFsird"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qluRU6tE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 201D520716 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.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:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=r87KrxEaZHasuwrhKM07NXl5E+6/VtIj5FaGtIo5YaE=; b=pXEFsirdaFq/RS2byCFEZn5n2 /lemjEUgKDxIEOMvE/opwzyPRnHgIyANjPPnoDfJiiIRwO+Rs+cfRYL3b8IU6wHyQzn23Ss6nPIO2 KqtbUD9+EzdyfJvuaDdEu1SBc60gK7+Ekn1rRcz4DeZQ59taR63XGm7BAvxXrXkRbqptk7iBx5wFK lzAU+lJnKugPWqUEbyU/498hCQJVoQNVnd6NNVBCsNk4heQmzsnf1ww0jQTDP5QaItjHLvcUklTEu 2vA8Yely2nq8vAR4IfPdNBiN13j7zlXq92C2HsYEGEUZIdaOL7oecaOXSZihP/PcfYUjXjOsi1HHC MsxGWufXg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDxfw-0000iF-Up; Thu, 03 Sep 2020 22:25:48 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDxfu-0000hR-D7 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 22:25:47 +0000 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (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 A1ABF20767 for ; Thu, 3 Sep 2020 22:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599171945; bh=UIAXSve0SRrcUd0B8D3XS6dXgn/vQBkLbJ8pkN798Co=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qluRU6tE3yEoLU2P/PGujeCsrKHYEEuTTVUhauwotQKC7B9OoafcrZW39TyQ+RWuU AOBoW9Eo44laSXkfHd3e6+DkRHt1Hu8KHa4U+OZiPVTYjSbeSWkfXmMuCDJEepbSRJ qccqng13joImKSahk+j3VAVuPZWx1O5WrcMQfqtk= Received: by mail-oi1-f169.google.com with SMTP id x19so4742197oix.3 for ; Thu, 03 Sep 2020 15:25:45 -0700 (PDT) X-Gm-Message-State: AOAM531SNOgW6Nk54kOThsxY27OHU2YS+mhZBaMIapXODj0WZK/HkL1L rtsKl6w08zkLftWENzB8XBpqByRZcYGATB6oPA== X-Google-Smtp-Source: ABdhPJwrVduZhw2vlihPd2/Z7wXfAVL2xOnsNA6Q5zcbi6DAiVrLsMvntTI9GWRi9G26Rm5JgVmKH/NsVP5BMycbvEE= X-Received: by 2002:aca:1711:: with SMTP id j17mr3621820oii.152.1599171945008; Thu, 03 Sep 2020 15:25:45 -0700 (PDT) MIME-Version: 1.0 References: <1596795922-705-1-git-send-email-hayashi.kunihiko@socionext.com> <1596795922-705-7-git-send-email-hayashi.kunihiko@socionext.com> In-Reply-To: From: Rob Herring Date: Thu, 3 Sep 2020 16:25:33 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 6/6] PCI: uniphier: Add error message when failed to get phy To: Kunihiko Hayashi X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_182546_551627_0F21FA58 X-CRM114-Status: GOOD ( 27.28 ) 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: devicetree@vger.kernel.org, Lorenzo Pieralisi , Masami Hiramatsu , Jassi Brar , Jingoo Han , PCI , "linux-kernel@vger.kernel.org" , Masahiro Yamada , Marc Zyngier , Bjorn Helgaas , Gustavo Pimentel , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 21, 2020 at 1:05 AM Kunihiko Hayashi wrote: > > On 2020/08/18 1:39, Rob Herring wrote: > > On Fri, Aug 7, 2020 at 4:25 AM Kunihiko Hayashi > > wrote: > >> > >> Even if phy driver doesn't probe, the error message can't be distinguished > >> from other errors. This displays error message caused by the phy driver > >> explicitly. > >> > >> Signed-off-by: Kunihiko Hayashi > >> --- > >> drivers/pci/controller/dwc/pcie-uniphier.c | 8 ++++++-- > >> 1 file changed, 6 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/pci/controller/dwc/pcie-uniphier.c b/drivers/pci/controller/dwc/pcie-uniphier.c > >> index 93ef608..7c8721e 100644 > >> --- a/drivers/pci/controller/dwc/pcie-uniphier.c > >> +++ b/drivers/pci/controller/dwc/pcie-uniphier.c > >> @@ -489,8 +489,12 @@ static int uniphier_pcie_probe(struct platform_device *pdev) > >> return PTR_ERR(priv->rst); > >> > >> priv->phy = devm_phy_optional_get(dev, "pcie-phy"); > > > > The point of the optional variant vs. devm_phy_get() is whether or not > > you get an error message. So shouldn't you switch to devm_phy_get > > instead? > > > >> - if (IS_ERR(priv->phy)) > >> - return PTR_ERR(priv->phy); > >> + if (IS_ERR(priv->phy)) { > >> + ret = PTR_ERR(priv->phy); > >> + if (ret != -EPROBE_DEFER) > >> + dev_err(dev, "Failed to get phy (%d)\n", ret); > >> + return ret; > >> + } > > The 'phys' property is optional, so if there isn't 'phys' in the PCIe node, > devm_phy_get() returns -ENODEV, and devm_phy_optional_get() returns NULL. > > When devm_phy_optional_get() replaces devm_phy_get(), > condition for displaying an error message changes to: > > (ret != -EPROBE_DEFER && ret != -ENODEV) > > This won't be simple, but should it be replaced? Nevermind. I was thinking we had some error prints for the optional vs. non-optional variants. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel