Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2017853pxu; Sun, 13 Dec 2020 10:43:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgxDPcyvidRlUJB4mS01W/7LxoOEzNO7fJDc3eWQFL7WbavccX9XnVJwfANUAYE8pkzxb2 X-Received: by 2002:aa7:c2d8:: with SMTP id m24mr7088021edp.300.1607884994664; Sun, 13 Dec 2020 10:43:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607884994; cv=none; d=google.com; s=arc-20160816; b=kx5EtC+QwBrt5/UiMJ/I3B5IftpY3/YOjbbxyCtIBRc8Mh2566oa8t5BqCuBGCqrXW Pgr2s1xXhHL+QG29SLp1bYjxTOLHseQpCGZLoWE6p3pYoCANR6XciRK3wzWjG3PRyO/J Q07n3tmZmr8tU7vhJk5CCE4pWDoCQNQrGd2MHwH2PKzj+dR/9coVgvk1OgOjS3Lh5kBX mSMobBtvM8MrU7L8vvn7r8kj65+Dj/FNdSC3Su0OH530kZAz4G5dZCmElKVkVGLMl7jD 2wNcE86dUBS1gSqAAMBmyvrk7ie6XwJtqdNACo13ikBCz5KGnewd+6ZdDINRyr27e2le LGIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5s7X/nOjA4XrKpMEKxmbe1OfV83VHJMvDQxbv5LSaFA=; b=z3W0kiKp1YKgRzZxo2eBNIkgjO8B5hh3xx6fVp+20q7tbkbkiaa/GUR0iQOFuWxT+T XhdSQtYgyticwmuhFXYUxPdMKO6+qc/mBcPBFqafx/Wd69Xu69Wc2Kg7ZIZk+DO9BvRR 9XeLRas/UtJ0dFkNJUvWUsTorCUctpYZXhMKbEQodnpWCshZk7fdQzIqOe6Esgl7KxAH S3F/G/0B3KYurrkQDeyQHEEALZKr8X3VIBZHR3nS6BlzBbDHmRg1dKnlgqd0ZaU2MB2v Cg6X/DAyuBRoD+HyZaRQaI1LePmda4S9e0nhHVppa5nAAy19f99ffly+cJtJ74yr4jic AV3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c52Gl7vG; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dg4si8666938edb.104.2020.12.13.10.42.52; Sun, 13 Dec 2020 10:43:14 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=c52Gl7vG; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394525AbgLMLbG (ORCPT + 99 others); Sun, 13 Dec 2020 06:31:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgLMLbG (ORCPT ); Sun, 13 Dec 2020 06:31:06 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E600C0613CF; Sun, 13 Dec 2020 03:30:26 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id n10so2506029pgl.10; Sun, 13 Dec 2020 03:30:26 -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=5s7X/nOjA4XrKpMEKxmbe1OfV83VHJMvDQxbv5LSaFA=; b=c52Gl7vGI6Xi0WjdktyI+AdNDCVuPehAzLeDAE0c95ZGdhDhVkq8yO1w/3p05ycZQm P8blzUYiWGopU/toreASmKceu7aGu7032QgzGivwF8fEFrW6zlHUNtgRNGtP/JB4rHzr jh4jbRTbJbIJ7l9S7TNAuE7b/j/GCsSjg0AupwkpMXd4yscT9mrC93AHARYN3JJZ0Al+ srGgg7pIlmPfiPwmgsGWX7qH4o76vwsADQfPdDnBIFUxnbkuH/BTMUPKVO/HA1uQjq9O Ml+7eMrZqnuiLqkGXMGhdYD10Ov1vAfJsKKswzGS40t8MIkUCjjV+aU7Xa0URWgvzfxs lmLw== 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=5s7X/nOjA4XrKpMEKxmbe1OfV83VHJMvDQxbv5LSaFA=; b=eooWznTaI3RJhBTr7SiXhQtnFN4B3+664j+4StPiyGeXX9EXPEYkcE700F/gqTWmsC JDJEXbM5A/aZ00rtEp04v+UWFPApyvhFryfKkjcv9wxMplcGHYgELGHLSqMtcCdWAk7p OnOM3O0cuuHbHpNIbTjJuGK1Ewmt5yiuJNOGtGPImqnJf7cFOqgRgkoVtMcDw+vEFBz6 mpjFwRjYL6UxFaT2KhWrdxeg8EMCrdIq05hcZFv2eM1G3OzwIrenj7zdG/xoyKO7PCSJ G4Nre/TzgfsA74gzj5eyYBkMzqWGkf8iCYIez6qL8jrfzB+um3eUFdy+VZAgDr7ESdR0 EUIQ== X-Gm-Message-State: AOAM533/oz8hic0vSTU83XEed/frm1WQ+yv7VQ4nKxM6temMtJH+2/Bl d4P9GAb2wd+fonFFjJcWZmU6rZU/Rdf22jxRcgI= X-Received: by 2002:a05:6a00:170a:b029:19d:afca:4704 with SMTP id h10-20020a056a00170ab029019dafca4704mr19205388pfc.7.1607859025920; Sun, 13 Dec 2020 03:30:25 -0800 (PST) MIME-Version: 1.0 References: <20201211211916.6259-1-semen.protsenko@linaro.org> <20201211211916.6259-3-semen.protsenko@linaro.org> In-Reply-To: <20201211211916.6259-3-semen.protsenko@linaro.org> From: Andy Shevchenko Date: Sun, 13 Dec 2020 13:30:09 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] usb: dwc3: drd: Improve dwc3_get_extcon() style 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:27 AM Sam Protsenko wrote: > > Commit c73b41955ee4 ("usb: dwc3: drd: Avoid error when extcon is The previous change ("... (because we don't know the actual commit id) > missing") changed the code flow in dwc3_get_extcon() function, leading > to unnecessary if-branch. This patch does housekeeping by reworking the > code for obtaining extcon device from the "port" node. While at it, add an extcon > the comment from mentioned code block, explaining how checking the port > availability helps to avoid the misleading error. ... > + /* > + * Try to get extcon device from USB PHY controller's "port" node. an extcon the USB > + * Check if it has the "port" node first, to avoid printing the error > + * message from underlying code, as it's a valid case: extcon device > + * (and "port" node) may be missing in case of "usb-role-switch" or OTG > + * mode. > + */ To me it sounds like this should be in the previous patch. -- With Best Regards, Andy Shevchenko