Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp884703pxk; Thu, 3 Sep 2020 15:27:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGk0R9ht8mNjBTBIvnpHtxmkIzVEqDncQbIYc0hJbJ2mj6enlrVii1t1oAtOgGRSxub9MG X-Received: by 2002:a17:906:b0c2:: with SMTP id bk2mr4345977ejb.20.1599172030887; Thu, 03 Sep 2020 15:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599172030; cv=none; d=google.com; s=arc-20160816; b=BDtpm6GVm00ngMBOkwhXB8qyS531VDmiKLQzm0fbnEJLFaxsfb4iCVBYcib70IyRai TT46uAvsLBXZcMFg0L3rTr/i/3wsGaFHPqpIrx3AO7Xu/4puT1ntHLzrQbx9vz/ocKtM gBGBqyH9Kgqe2UP0bu/60zDV6VSJWVORs0SHqNRWj3NYTAcQhhsSn4wURkIiYXIMAPwI KwJEu+CB3rDudfqF/0LuNOzPmAb1554IdGOSAn3zEI5VKrrkeXdiAuWKQyFpKZJfHkzm 9hBGzVkRPxfltKRlhaAWD1s8ZB7dy0M/WaQi5MHtaOv2ZR7F17mN/zLTZhob3/2r08JC GwsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hViGtLA5KQz7SSxZhdTkkFP4PaZGvv4D10ctRDI8JWc=; b=k1dI5NmOdb59OD9lXDSRU4on9EshqtnL5PCk3DMsOYfdjI4pHMVmNtSxxgQWsdrVdN DrJgjL1VkS2CwzDxdgwbROldFjtpLDMaWOBK527hC/7urXTHIArHLXFfCnqhbpEQRKA9 BZ0k9tOP2v9KsUf9h+LhMuouqWrN8O95hdyONTFTpD2TBfAiM0EFpN80fMIghntWLlUe nsuxGzVqOl9CwTY4eC6EtChY1yRBEvQbjrqS0rubPIUSQ1nJTCzI40cxSQlNL7XX4ZPk Dk5f2N/2hXkf//l5KDmhSUkWBjBClrSBuDwWCGuY5Q6O1lWKFR8h0x4hgYb8Bw95q2BB uyQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qluRU6tE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si2651464edo.487.2020.09.03.15.26.47; Thu, 03 Sep 2020 15:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qluRU6tE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728382AbgICWZr (ORCPT + 99 others); Thu, 3 Sep 2020 18:25:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:32886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbgICWZq (ORCPT ); Thu, 3 Sep 2020 18:25:46 -0400 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 ACBE820897; 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-f173.google.com with SMTP id 3so4765417oih.0; Thu, 03 Sep 2020 15:25:45 -0700 (PDT) X-Gm-Message-State: AOAM530a2GkD2fS6KFhiNQVGHp3iCAWAI4y5ws74NCVzpiQTpxa8eEuD LJfzLpJwfHSXX8d2klYoFG0UqAbgOW+msB0+Bw== 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 Cc: Lorenzo Pieralisi , Bjorn Helgaas , Jingoo Han , Gustavo Pimentel , Masahiro Yamada , Marc Zyngier , PCI , devicetree@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@vger.kernel.org" , Masami Hiramatsu , Jassi Brar Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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