From patchwork Thu Mar 22 13:06:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 889365 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Yz/QrxYE"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rWIXzTYg"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 406RpM5SJGz9s6v for ; Fri, 23 Mar 2018 00:09:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qW8BjfVdGcRjDicyYAJeoeKUXNHoocgjXLN1h0ZS3Bg=; b=Yz/QrxYE8LpKG0 X0YivoY6bguvFJ9llT67MLH1nHIyw/7r2SUMtoWOqtMDjCmnfdD1QeVx5Iog58E3cLxXpQOu/1DZz AkEGdVpn3kujeVrqvySBvAq0k6MWh/0quOfbAZ5CtHPjWaHPNaUHD/1f1Vj392l/8czkwpy/77iiZ 39EMNzZNRCvKN5dpYzXbaTHMZfH37yD2mlzMnzcFZXomRyoy/mWAD+GZau1XuHYa+67AKysdlurRO BHTKjMdLsXJg5us8dSYW3Lbk9OPDCX4qihxjmRGvQCeEj94ECfFjBAlTPSSrC+mljyWEM7DoM9pmc 5mlb1QJMn19qE0APeNNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyzyB-0001uv-6o; Thu, 22 Mar 2018 13:09:27 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyzwk-0000tA-H7 for linux-arm-kernel@lists.infradead.org; Thu, 22 Mar 2018 13:08:11 +0000 Received: by mail-wr0-x243.google.com with SMTP id s10so8610359wra.13 for ; Thu, 22 Mar 2018 06:07:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=smlzWBsMeoNxvNMALDbLXY/cu+SyyQJX3YiuFm8IetM=; b=rWIXzTYgCkpqX4mHVlkzOcN3AzdHzhaB05Qr3sVWYmyrVNZ4k6rwBKQ4iKx0a0gFVi XwxKK3gHIymuQhLcxNctEqlA9gS6POtOP1ln9pRmRqtcaxXz+tKO9z5pCE/Lx9lN5Sx7 Za56vxCtDKbjRpOR/t0lu5o37ux8n/W4hJ/5eT06BiQ4llXwzBvfL7DlyDGN9FgtjkMs g1QyhoOXie135SVIyK041HwNpkIrSRDLZDkkox0/uA8Bm0H8C5F1zKUoL/n0d3Mdx+VT JvWpSN2ORlaoi5WxQeFbe7HGgzg2oBpFDREzwVHO8KuFToNPMddjaO4moB+y9NZdD1m+ ZAVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=smlzWBsMeoNxvNMALDbLXY/cu+SyyQJX3YiuFm8IetM=; b=Blw9MgoH5uy5o7SriwzY1LA7jx8quPiDcnl0jRNwfK8aYhenpIl0H4vGNSoqVdUFis 6peAS4+cF8lFTPfpadEn3G+e5NCdEGM2TR83SLcqQwNHtC+Gq8cx/pUPRW/I/swAg322 bSMcWa/2sLqpPIRnBJno7gc68q39ChUTIypeNoqiaTZBB8LM9pSdH50Vk86nDI1ehZsG ETSZWYQ/WWTe6tBLJcmuguL5F5oji5YzkJt9b4xVIK/78j7WsuuRBOaGX0uPAgVNzWKd Qh62ogti9R3TVJ24+7dpSKW+RCkLowsJdttMsuFwMRDXhByukQPQ4T97NVH9C7jplztV NZJg== X-Gm-Message-State: AElRT7GYN+gdFLfnV6atbQHxZVtlHAa+vL4yOoahw8BBaKnOqV8U8AT0 Gx90PGhmOAaWq9SrOmhPKyk= X-Google-Smtp-Source: AG47ELspHF9YtPMg9EiaxVvLwU4x4qjORSrpOvVjBguQhLrijL0ICIQ6TYj0GKehSy1JQaavxAJi4A== X-Received: by 10.223.171.79 with SMTP id r15mr2463378wrc.208.1521724066471; Thu, 22 Mar 2018 06:07:46 -0700 (PDT) Received: from cizrna.lan ([109.72.12.73]) by smtp.gmail.com with ESMTPSA id f22sm13800267wmi.39.2018.03.22.06.07.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Mar 2018 06:07:45 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH v2] usb: dwc2: dwc2_vbus_supply_init: fix error check Date: Thu, 22 Mar 2018 14:06:39 +0100 Message-Id: <20180322130639.9957-1-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180322093943.49717-1-tomeu.vizoso@collabora.com> References: <20180322093943.49717-1-tomeu.vizoso@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180322_060759_269931_95138F5D X-CRM114-Status: GOOD ( 18.06 ) X-Spam-Score: 0.5 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:400c:c0c:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (tomeu.vizoso[at]gmail.com) 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felipe Balbi , Amelie Delaunay , Heiko Stuebner , Tomeu Vizoso , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Russell King , Minas Harutyunyan , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org devm_regulator_get_optional returns -ENODEV if the regulator isn't there, so if that's the case we have to make sure not to leave -ENODEV in the regulator pointer. Also, make sure we return 0 in that case, but correctly propagate any other errors. Also propagate the error from _dwc2_hcd_start. Fixes: 531ef5ebea96 ("usb: dwc2: add support for host mode external vbus supply") Cc: Amelie Delaunay Signed-off-by: Tomeu Vizoso --- v2: Only overwrite the error in the pointer after checking it (Heiko Stübner ) --- arch/arm/configs/multi_v7_defconfig | 3 +++ drivers/usb/dwc2/hcd.c | 11 +++++++---- scripts/setlocalversion | 9 --------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index 846ce7bb24bc..33148fcabd17 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig @@ -1029,3 +1029,6 @@ CONFIG_VIRTIO=y CONFIG_VIRTIO_PCI=y CONFIG_VIRTIO_PCI_LEGACY=y CONFIG_VIRTIO_MMIO=y +CONFIG_LOCALVERSION_AUTO=n +CONFIG_LOCALVERSION="" + diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index dcfda5eb4cac..863aed20517f 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -359,8 +359,13 @@ static void dwc2_gusbcfg_init(struct dwc2_hsotg *hsotg) static int dwc2_vbus_supply_init(struct dwc2_hsotg *hsotg) { hsotg->vbus_supply = devm_regulator_get_optional(hsotg->dev, "vbus"); - if (IS_ERR(hsotg->vbus_supply)) + if (PTR_ERR(hsotg->vbus_supply) == -ENODEV) { + hsotg->vbus_supply = NULL; return 0; + } else if (IS_ERR(hsotg->vbus_supply)) { + hsotg->vbus_supply = NULL; + return PTR_ERR(hsotg->vbus_supply); + } return regulator_enable(hsotg->vbus_supply); } @@ -4342,9 +4347,7 @@ static int _dwc2_hcd_start(struct usb_hcd *hcd) spin_unlock_irqrestore(&hsotg->lock, flags); - dwc2_vbus_supply_init(hsotg); - - return 0; + return dwc2_vbus_supply_init(hsotg); } /* diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 71f39410691b..cbc36d3b4d0f 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -161,15 +161,6 @@ res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}" if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then # full scm version string res="$res$(scm_version)" -else - # append a plus sign if the repository is not in a clean - # annotated or signed tagged state (as git describe only - # looks at signed or annotated tags - git tag -a/-s) and - # LOCALVERSION= is not specified - if test "${LOCALVERSION+set}" != "set"; then - scm=$(scm_version --short) - res="$res${scm:++}" - fi fi echo "$res"