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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 8FB07C4361B for ; Sun, 13 Dec 2020 11:27:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5179A22C7D for ; Sun, 13 Dec 2020 11:27:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393097AbgLML1X (ORCPT ); Sun, 13 Dec 2020 06:27:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgLML1W (ORCPT ); Sun, 13 Dec 2020 06:27:22 -0500 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94550C0613CF; Sun, 13 Dec 2020 03:26:42 -0800 (PST) Received: by mail-pj1-x1042.google.com with SMTP id b5so4949420pjl.0; Sun, 13 Dec 2020 03:26:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FiB/9WTUgU4k/cf1D0blDI9YAXhtbx3zQedTzR+o/44=; b=Q39cbSGJNxB7lNbK8VSBdugLFAqITRcxO5zVgeyE5kdwfTpPgOc2INZ1pyzUFoQh1y tUhGBX+d2U/ThdHvcwJPW4v/O9C34HsjzrCGUwCcdLDNWoF3K6WpbChyvgUNyvPDB47j hPjkMtcbWSfpj//r1NvWwPjfB/1LuJ7yB3dP7fVxHQINRJl/cAR77mNmxUiKPqTpD1P2 nVBL1E2FQtNurAj6gU5m9ZQ3Fjj0oIitNmIix1jgMDTh2AJgkGWufl4qzYYEH0Ahl5Dv Q6PcAxESb0StC6/Hz6npHFTKxLHjhUEhr33RStPxZXUe+iwHiNfwgQ5RFtTWKDyoemZZ /rvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FiB/9WTUgU4k/cf1D0blDI9YAXhtbx3zQedTzR+o/44=; b=X3rly3nib5HQOKhuUPqS4/FncqrjcfF2PLPn5Msdaoi+Jpm+Ho7GzDoNo8yMzsiG4m pw3QgANbRiUw6A1oUVFB1D5YfgiU0j/ytpqlEZadgolZGiolHBp099A7aGKzAgn1Z8qo iiX3EK0+lBc90+dJRjf4WPxyxHd9jZR2zbG6//tKFr3VZ1VNMjP3ZCIS8K0w8rlssmxU xRRT+gQs8dx1Fhdz3ZsnkaPkZPwYtfTu8QizLv5gNFXxRPzuegEGaF7B+uuv+IfoLDWt ogpJqD0DZOPiWYdWjrsTc2RxK3QOP9REyDvv0YfCdSo14FQ6GgDCNIXgNYmUvICKlm9k YXFw== X-Gm-Message-State: AOAM533fXJPw88Jsa27t4GEt3Ch0ZpI1gwLzfQGyIWObMXr4Lk2B0tyw UyK0jaHI2al5OZz+0W94c61EEiB6ljiN6V4CTJQuPiNkqHA= X-Google-Smtp-Source: ABdhPJwiXtXy2oACWVRlcBjf9y8PHvLNGqnrluOTNM7ptACjV1zVSZgM0Rd9w5rg3AWZmxqci4j6W1Ugz/T97lZlbXY= X-Received: by 2002:a17:902:b7c3:b029:da:76bc:2aa9 with SMTP id v3-20020a170902b7c3b02900da76bc2aa9mr18484847plz.21.1607858802089; Sun, 13 Dec 2020 03:26:42 -0800 (PST) MIME-Version: 1.0 References: <20201211211916.6259-1-semen.protsenko@linaro.org> <20201211211916.6259-2-semen.protsenko@linaro.org> In-Reply-To: <20201211211916.6259-2-semen.protsenko@linaro.org> From: Andy Shevchenko Date: Sun, 13 Dec 2020 13:26:25 +0200 Message-ID: Subject: Re: [PATCH v3 1/2] usb: dwc3: drd: Avoid error when extcon is missing To: Sam Protsenko Cc: USB , Linux Kernel Mailing List , Felipe Balbi , Greg Kroah-Hartman , John Stultz , Andy Shevchenko Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Dec 13, 2020 at 5:22 AM Sam Protsenko wrote: > > If "port" node is missing in PHY controller node, dwc3_get_extcon() > isn't able to find extcon device. This is perfectly fine in case when devices > "usb-role-switch" or OTG is used, but next misleading error message is > printed in that case, from of_graph_get_remote_node(): > > OF: graph: no port node found in /phy@1234abcd > > Avoid printing that message by checking if port node exists in PHY node if the port > before calling of_graph_get_remote_node(). Reviewed-by: Andy Shevchenko > Signed-off-by: Sam Protsenko > Cc: Andy Shevchenko > --- > Changes in v3: > - Split patch into two patches: logic diff and style diff > > drivers/usb/dwc3/drd.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c > index 3e1c1aacf002..312a4d060e80 100644 > --- a/drivers/usb/dwc3/drd.c > +++ b/drivers/usb/dwc3/drd.c > @@ -463,7 +463,10 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc) > } > > np_phy = of_parse_phandle(dev->of_node, "phys", 0); > - np_conn = of_graph_get_remote_node(np_phy, -1, -1); > + if (of_graph_is_present(np_phy)) > + np_conn = of_graph_get_remote_node(np_phy, -1, -1); > + else > + np_conn = NULL; > > if (np_conn) > edev = extcon_find_edev_by_node(np_conn); > -- > 2.29.2 > -- With Best Regards, Andy Shevchenko