From patchwork Mon Jun 5 17:19:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Edwards X-Patchwork-Id: 1790589 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=ntk6vrNM; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QZgNF6jZRz20QH for ; Tue, 6 Jun 2023 03:20:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E8855846F6; Mon, 5 Jun 2023 19:19:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ntk6vrNM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D3C2E846F6; Mon, 5 Jun 2023 19:19:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8D0D9846D5 for ; Mon, 5 Jun 2023 19:19:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=cfsworks@gmail.com Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-777b46516ddso58847539f.1 for ; Mon, 05 Jun 2023 10:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685985592; x=1688577592; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pd6/j2Z//1hEHCQN+JCDl6R0yHyFBjL9c1I+xzqXsik=; b=ntk6vrNMp+lS0gDNezEk/ctpKf6dDcZS5Q+NgTJZTGFkSA/uiPfvGfXhj0zUlFnzMR XenfHnx6jtfmscJt9J2MQgOYBCkRZ0onw1sduT/77rCIcr1ZevMgmzemzYImxr8s66ev ameL3MO421dVaJtxAsrSovETuPzx2aLZUerMRwhD1vrYG6hEVX55ZTzHwbAdzI6gwBXM BmFl8p3uNsu9hup/0yZmToWIpHmvh1Ig7SMeAMS1t5hp+aU7C0vJSs4sGcrcIQER0YYW Vjgg7WVvgW3+epPCa04fFN8HzQhQ3mc1c5cBfeL6WNJp9yN9CfmqH6rAlfmZOjzhumpL TVIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685985592; x=1688577592; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pd6/j2Z//1hEHCQN+JCDl6R0yHyFBjL9c1I+xzqXsik=; b=Dv0SHEr74/lxexRuC/1tLpe1BYldyP/g3vaskTPqoAbyAP8CogGp6a4Z2Gvb4Fet/u fWOp9OmIxHO7yGKPU8BEvnsVw9kTjpX3woAEPUURLLgHbuEDT5OfK8Ki4JGrPIKqxFIn sA6bkUin6FR5cUsqj06CkGgRwH+spW81e+/f6BD7fr7kQFY25IbF77G7Yk3IogVNeZy8 7s9ls3iDhVgLatVk6M2Zeo8a0/MtC0SFRQSSnoO/8bzijBK895Kz3dNBER6jumTHicGv cWPyEEaux6P7XUxo3O/xfpNnC5FosU181GZh12OGjXPkJIGh6F5wxZefGKfGgN8Vfzej 2rvA== X-Gm-Message-State: AC+VfDxGwkI7vlgu6739F1ghkLKKnKECe6uwcyIkfcuKVAIolV5QEtEs SZ3aouU/5sQtCALeWz5RxWktBAUjzTO3ztUU X-Google-Smtp-Source: ACHHUZ5xlNLJxramHvc0YpH3y7s6m9Z06nxtWjvgpXqxMJv/7Qk5YnzgOasklu/IVNWYac1QWG2b8w== X-Received: by 2002:a6b:f614:0:b0:777:b531:eb56 with SMTP id n20-20020a6bf614000000b00777b531eb56mr429609ioh.7.1685985591985; Mon, 05 Jun 2023 10:19:51 -0700 (PDT) Received: from celestia.nettie.lan ([2001:470:42c4:101:d63f:9f67:147:c63f]) by smtp.gmail.com with ESMTPSA id m3-20020a056638224300b0041d759c451asm2286013jas.166.2023.06.05.10.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jun 2023 10:19:51 -0700 (PDT) From: Sam Edwards X-Google-Original-From: Sam Edwards To: u-boot@lists.denx.de Cc: Andre Przywara , Jagan Teki , Marek Vasut , Maksim Kiselev , Sam Edwards Subject: [RESEND PATCH] usb: musb-new: sunxi: fix error check Date: Mon, 5 Jun 2023 11:19:37 -0600 Message-Id: <20230605171937.3286-1-CFSworks@gmail.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The `musb_register` function returns some ERR_PTR(...) on failure, not NULL, so update the check here appropriately. Signed-off-by: Sam Edwards Reviewed-by: Marek Vasut --- drivers/usb/musb-new/sunxi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb-new/sunxi.c b/drivers/usb/musb-new/sunxi.c index 6e60dd47e0..65a528e229 100644 --- a/drivers/usb/musb-new/sunxi.c +++ b/drivers/usb/musb-new/sunxi.c @@ -488,7 +488,7 @@ static int musb_usb_probe(struct udevice *dev) #else pdata.mode = MUSB_PERIPHERAL; host->host = musb_register(&pdata, &glue->dev, base); - if (!host->host) + if (IS_ERR_OR_NULL(host->host)) return -EIO; printf("Allwinner mUSB OTG (Peripheral)\n");