From patchwork Fri Sep 23 16:30:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12986773 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A8B3C6FA82 for ; Fri, 23 Sep 2022 16:30:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232851AbiIWQan (ORCPT ); Fri, 23 Sep 2022 12:30:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232774AbiIWQal (ORCPT ); Fri, 23 Sep 2022 12:30:41 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF39D13D1C5; Fri, 23 Sep 2022 09:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663950640; x=1695486640; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kEgvzogpaPwbBUkOGpIaZlz4r7Tx+XGTRVH+PsdvaJw=; b=bsFDJmRgAiISbv+Lgi2lLN1Q/amf2Ixubonfl/4CkKt3eqXktNMVlg/r KCaGtu+md1CgE1RweywuHpF0bUWMZK79mGCKwHbWNBVITOUPw97jsgih0 Sq9J1VhrBG5SrxRBHjUZffMx89O3NrfmnoFvaGYy1CabWAdjfT7mWY7xB fRz+ubNK2HqlLZY0UvvSAq8r7HCNUlrqA7ZkfjQTz8+aiOs1y+4zxYygY JZaNeOk7vvUu0Ol/PQgrQvPTi0CuGqvzpFgk4nQgWfYsrj4qJnAS3gJIS O1XSJ0gyCYsTviP0xAUuqEXoQgOAYkr8MpTIrJ101eHtgouvXGmq8RjF7 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10479"; a="326959481" X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="326959481" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2022 09:30:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,339,1654585200"; d="scan'208";a="651005924" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 23 Sep 2022 09:30:38 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 503D0235; Fri, 23 Sep 2022 19:30:56 +0300 (EEST) From: Andy Shevchenko To: Greg Kroah-Hartman , Andy Shevchenko , Andrey Smirnov , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Felipe Balbi Subject: [PATCH v1 1/2] Revert "USB: fixup for merge issue with "usb: dwc3: Don't switch OTG -> peripheral if extcon is present"" Date: Fri, 23 Sep 2022 19:30:50 +0300 Message-Id: <20220923163051.36288-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220923163051.36288-1-andriy.shevchenko@linux.intel.com> References: <20220923163051.36288-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This reverts commit 8bd6b8c4b1009d7d2662138d6bdc6fe58a9274c5. Prerequisite revert for the reverting the original patch. Signed-off-by: Andy Shevchenko --- drivers/usb/dwc3/core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 8c8e32651473..b3ae53be2112 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1684,8 +1684,13 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc) * This device property is for kernel internal use only and * is expected to be set by the glue code. */ - if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) - return extcon_get_extcon_dev(name); + if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) { + edev = extcon_get_extcon_dev(name); + if (!edev) + return ERR_PTR(-EPROBE_DEFER); + + return edev; + } /* * Try to get an extcon device from the USB PHY controller's "port"