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=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 C2C48C433DF for ; Fri, 21 Aug 2020 07:07:42 +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 92D322078D for ; Fri, 21 Aug 2020 07:07:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2jICpK3S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92D322078D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=socionext.com 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=OffEbX11ekPKwYTxjztulaLm52bd0So5m4gGVblVpBU=; b=2jICpK3SoVUbo47t8VopzTwCi 3FpDXe5Ebcfb1g7kDZh0AXv32NfXgqxk7TXDBcXtwEdJNuyyzOShHUkZ9H+Z2zAQ51noNA3fJnt7P hxriiNnZ223luUDsZNbBJ7TUrXtJJrF1cRUm526tfB5bP87prLgqiogamQu5ZavJdnvWy1Tt9Dgvo emyRC4VYlixdStOI6yIxS8BnzS/cQlUvNIGHe60CZw3+Dm2x2FPxwUe3KP3kzrcyOSDUdQmcCMaPQ XfI8kluG1nn9YSxSl4yBLISnRiLdWgYp2r9ntmOqu+sVGizn/BjdPEJYbaL+tVKaK6ZiZ2Fs4BP3W TeJfjOWbQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k9178-0002WB-8h; Fri, 21 Aug 2020 07:05:26 +0000 Received: from mx.socionext.com ([202.248.49.38]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k9175-0002Vi-Oy for linux-arm-kernel@lists.infradead.org; Fri, 21 Aug 2020 07:05:24 +0000 Received: from unknown (HELO iyokan-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 21 Aug 2020 16:05:21 +0900 Received: from mail.mfilter.local (m-filter-2 [10.213.24.62]) by iyokan-ex.css.socionext.com (Postfix) with ESMTP id A700A60060; Fri, 21 Aug 2020 16:05:22 +0900 (JST) Received: from 172.31.9.53 (172.31.9.53) by m-FILTER with ESMTP; Fri, 21 Aug 2020 16:05:22 +0900 Received: from yuzu.css.socionext.com (yuzu [172.31.8.45]) by iyokan.css.socionext.com (Postfix) with ESMTP id 5EB784036B; Fri, 21 Aug 2020 16:05:22 +0900 (JST) Received: from [10.212.1.43] (unknown [10.212.1.43]) by yuzu.css.socionext.com (Postfix) with ESMTP id BA90C120B93; Fri, 21 Aug 2020 16:05:21 +0900 (JST) Subject: Re: [PATCH v6 6/6] PCI: uniphier: Add error message when failed to get phy To: Rob Herring References: <1596795922-705-1-git-send-email-hayashi.kunihiko@socionext.com> <1596795922-705-7-git-send-email-hayashi.kunihiko@socionext.com> From: Kunihiko Hayashi Message-ID: Date: Fri, 21 Aug 2020 16:05:21 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200821_030524_026596_704BDC0A X-CRM114-Status: GOOD ( 29.38 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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? Thank you, --- Best Regards Kunihiko Hayashi _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel