Message ID | 71499112-4ed3-489a-9a56-b4a8ab89cd05@moroto.mountain |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-45878-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1719348dyb; Tue, 30 Jan 2024 23:14:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzR2IGodICeYszvDK3v3UNXDnXN5ap9iijiQXcxgfVPHw7TSeXBTqcZuV7vDBlHkkNjfZ0 X-Received: by 2002:a05:622a:1999:b0:42b:cae1:f6f5 with SMTP id u25-20020a05622a199900b0042bcae1f6f5mr3272808qtc.63.1706685282749; Tue, 30 Jan 2024 23:14:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706685282; cv=pass; d=google.com; s=arc-20160816; b=hFWJjYhEv8VXvPU1zIIOOHS03M79Dqm90b1Cwjhqg0wEx2UftHMwLLhJiZ+lZ3pJPd 40vMS0oSf2JV2e7HmwV24SpYy81WgfYQNjJLXyspEI07E6dSBJOgSP6WAYVPSz3K92Nf OnRXQ3B3urbUwY2jOmiPKCsFr6f220OAqnRwr62I6rjDQy502aWqrMOxcGExZC1RsvhU 3R8NS3eg++M0vC1ApctY/Sk8kfHNcwnliX0mDALLufNT4pj6CM+PN6Ck5c4AawVRHbGG dCwTqetNg1J2iGcppWhcjEeGPuU3SUyO6s2ZhbrKho4A8lcxXFQATMkiSh/MqkNbrnC4 y0pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=w6SrONxAcUL+4nL4MAcXtd1azhlAyrb6XByXAS01m78=; fh=EeizjrBJJpBBmULe79ydJ7Dc+OfI4b6cQBCa/Hnadd0=; b=JOAVwgZLv18S0ep1IzK7YtkZ3o+tGmkqBgbXpBwR4BeSDpTokCM/GgDBfhIm8otzC+ R4FqoGnhKpVGX/NHVSJ326HlhpcsYuTzUjeSB1Py8QsFw0EkRo6E1iSdZf83gEHuKCll 8vBELVTuWu7SU0an74iMVSainl50DKFnjxQd65xHytjoZ2IcV2iHopwQ6oFwYIJlKSBc IvY1+D052HbUXp5qPmI383MoqoEyjOylFYq6sGB/0B9CzpLvYCEQsNhHqA93NtJmkitn xRODrvwIico/bxaLrIxun8GSm2aS1ipyaQrYljq8eOHazFXi6P1+57RyiLhoB2K0Ad8g rZDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O6IBb2YB; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-45878-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45878-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=1; AJvYcCXOnlXEgqdi/abFc0DEqPVRoaKGy3AvCUuRf/E5aJbSFfCkwWkCYJYN0Plynn49jIfxeTK04rhF2ZcHX3z95qxPLDG6bA== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m9-20020a05622a118900b00429d0dc308dsi6896389qtk.62.2024.01.30.23.14.42 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 23:14:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45878-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O6IBb2YB; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-45878-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45878-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8998C1C240D0 for <ouuuleilei@gmail.com>; Wed, 31 Jan 2024 07:14:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 112DF605DC; Wed, 31 Jan 2024 07:10:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O6IBb2YB" Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8471D4E1D6 for <linux-kernel@vger.kernel.org>; Wed, 31 Jan 2024 07:10:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706685034; cv=none; b=qOjBX/1lm+dZbkFJkm2muPJHnwQbPxaukbNRt4OADE+oracy8TMr8XvWliCKbExB+V2GlSsjr0SpNBQlF87lC7AKBzmUbdwzQ5zq4cFJeKCT6KbEHKV1mqwdD98Jl2KrF0wnsvlEOjv2daGrS9ADrnmPEqpmaHIx1FrulyGlrnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706685034; c=relaxed/simple; bh=9s6fOH0qLp1ufgO9rf8HAxDGnWALf+j204n54W87KLk=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=kqIgWsCgqRxDLOrdZHB8y63oCpGGULRc4Cuh9Mv48po41nf1nF36rK3BJHhrdV24DaNLx7ZfK40fbHcPrTo0zxzYNbUfaerx8XMpYu2PvxfdQQBthNSYDvgn5GNFv443A3Ta746xm5wul/2jSF3ZWwjkUexRkdnT0+JoClEIDmQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=O6IBb2YB; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40ef6bbb61fso25233875e9.1 for <linux-kernel@vger.kernel.org>; Tue, 30 Jan 2024 23:10:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706685031; x=1707289831; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=w6SrONxAcUL+4nL4MAcXtd1azhlAyrb6XByXAS01m78=; b=O6IBb2YB/PMEmbZy4aNTyIcgIvxY81GNbSWuTY/KCqu429NrsAe9Fd0scpAYXK/gBf sLmR02ZcxyQERtCzVZyBn7YjqoTHKGPA/TDR0Hi7uFSmxMinrusGbXnjX4rYbBa4/qqP +D3BHk66gr27a8NNkBmphT0hQ9pAB4FsMfmwbfw/jj2qSBbEjBfUAJTVGIUiA0crkoa0 7PcOtY2fZ+1KwXBoO6YLqYzOSq6ArDxrDfUyMFyyw9STI5UqTH7h28pr5pDKtPCFfAAB +SQkmHfk5cuIP0eXyIvVAOnt2nijFX253nytdK9076qAtz1JDgHH4OP3aeqCGejIsTCw zK2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706685031; x=1707289831; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w6SrONxAcUL+4nL4MAcXtd1azhlAyrb6XByXAS01m78=; b=HUaTh2msMRttbwOXPD0LwGRE9zUZx4qZ3tjWw4aIe8/PTTiRPdikywfIB8CuUJ4v6B 8//wjOH86LM/uJ1BsWtKv8628HpMKjjdL7oVMqPWR7CErk+dFnVmSeKk95V7sl25p8eO P1+QyGkPPRervLiv7kICxCUSz09f27Lnb1ipOfRTY5PV1ED88Ko9qZSBVDd+MVJYnVfR 9LiLC8sHN4bBc0jTclc8KeA9+qJS9LOySd0lkUsEbor0DoCDWS6GX6lbMStu796kSJsE D7dCyCxeRtpRxwWLqv58BBdRxUUN1KkUqTWknd81BwUwb0SpoqT4gBdRC+uejMcILSzc mc9w== X-Gm-Message-State: AOJu0Yx5eVgBjYfY34x5R+zga1oXBZjBWInW9DBJMraOtzAxjHyGYKzM jHpXK6n76kr4sClqJBi07xWjfzHuj4qcMqDsCFn9P25xKy4Q/KCgjvWvlvTBLYo= X-Received: by 2002:a05:600c:4451:b0:40f:225:c607 with SMTP id v17-20020a05600c445100b0040f0225c607mr585093wmn.14.1706685030837; Tue, 30 Jan 2024 23:10:30 -0800 (PST) Received: from localhost ([102.140.226.10]) by smtp.gmail.com with ESMTPSA id j27-20020a05600c1c1b00b0040ef622799fsm657432wms.37.2024.01.30.23.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 23:10:30 -0800 (PST) Date: Wed, 31 Jan 2024 10:10:27 +0300 From: Dan Carpenter <dan.carpenter@linaro.org> To: Ran Wang <ran.wang_1@nxp.com> Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Peter Chen <peter.chen@nxp.com>, Frank Li <Frank.Li@nxp.com>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] usb: dwc3: Fix an IS_ERR() vs NULL check in dwc3_power_off_all_roothub_ports() Message-ID: <71499112-4ed3-489a-9a56-b4a8ab89cd05@moroto.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789589226968342006 X-GMAIL-MSGID: 1789589226968342006 |
Series |
usb: dwc3: Fix an IS_ERR() vs NULL check in dwc3_power_off_all_roothub_ports()
|
|
Commit Message
Dan Carpenter
Jan. 31, 2024, 7:10 a.m. UTC
The ioremap() function doesn't return error pointers, it returns NULL on
error. Update the check.
Fixes: 2d2a3349521d ("usb: dwc3: Add workaround for host mode VBUS glitch when boot")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/usb/dwc3/host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Wed, Jan 31, 2024, Dan Carpenter wrote: > The ioremap() function doesn't return error pointers, it returns NULL on > error. Update the check. > > Fixes: 2d2a3349521d ("usb: dwc3: Add workaround for host mode VBUS glitch when boot") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > drivers/usb/dwc3/host.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c > index ae189b7a4f8b..4e6239d3a0ac 100644 > --- a/drivers/usb/dwc3/host.c > +++ b/drivers/usb/dwc3/host.c > @@ -35,7 +35,7 @@ static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc) > /* xhci regs is not mapped yet, do it temperary here */ > if (dwc->xhci_resources[0].start) { > xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END); > - if (IS_ERR(xhci_regs)) { > + if (!xhci_regs) { > dev_err(dwc->dev, "Failed to ioremap xhci_regs\n"); > return; > } > -- > 2.43.0 > Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Thinh
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index ae189b7a4f8b..4e6239d3a0ac 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -35,7 +35,7 @@ static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc) /* xhci regs is not mapped yet, do it temperary here */ if (dwc->xhci_resources[0].start) { xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END); - if (IS_ERR(xhci_regs)) { + if (!xhci_regs) { dev_err(dwc->dev, "Failed to ioremap xhci_regs\n"); return; }