From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EC82FC4332F for ; Mon, 17 Oct 2022 21:31:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9650784F7F; Mon, 17 Oct 2022 23:30:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="AwkoNH3b"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C0A8F84F70; Mon, 17 Oct 2022 23:29:30 +0200 (CEST) Received: from mail-vs1-xe34.google.com (mail-vs1-xe34.google.com [IPv6:2607:f8b0:4864:20::e34]) (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 3765084F62 for ; Mon, 17 Oct 2022 23:29:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-vs1-xe34.google.com with SMTP id 126so12836965vsi.10 for ; Mon, 17 Oct 2022 14:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:references:in-reply-to:from:sender :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=W6guzeJUSYnqaj5WBbr9+gh8snOi15xZXgcz9LfgFB4=; b=AwkoNH3bAVtCh6yNnVAAMCg1AltUccuBY2mQSNRpWuvllQrkWKHYQK8d+lmegpVk40 0CxaswCPrPt9mKdiFsiMUJuLRWvroxU+gTfoIQW1vTVtX1KNtF+EGilnOp0H5nX7s5Qw TvhqTzrkc+dcZ9s2U6ZIx8Ywgu96apZ6vhS8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:references:in-reply-to:from:sender :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W6guzeJUSYnqaj5WBbr9+gh8snOi15xZXgcz9LfgFB4=; b=CRf/u7pEJkiNna5WeyD08Sg7onXHxTY2ZRy1TXZ7mp8EMGSIUJR+S86UH/pepcdt1t bulUBY9viZAtX3bl5eqHTzwGYzAvA2tpXg7ntqicRkPmUkP8OGcsVqbX9qNdyFNQgp3F TMLdVc13BxUUduBAuJtle4xDSnseT9/ayTx4hr/Jn7XJoB7cBZYa8RssB5Q/+QaHVeNa vrp0yrQyJ0sM4aHH6XeUJOaU52KTKAY1/Z082Cfgz+6ATrUb8BnnTwM8IHu5TJbG+FWa 7XyCjDIIM62sKwF0d3bSIhSmfgrPhEqL+64oAG4j6Mdu5M7QzgYE1ANfA2y1xwaLHPGk gNcA== X-Gm-Message-State: ACrzQf0kJXlQWMwRixCtibLCHFw0abX/to/bWUO0Fc3pprAuCRIBHJlm 9viGA/OfvX+COosX3DY542skkxiX7luM0REzLIwxtw== X-Google-Smtp-Source: AMsMyM4j3OTZCyX9U4ebmWl7E4j37EmSj1tN4y6fm///u8ss6nkwSz3+t0dohkqWn0BzgmfuQBbU+Llk/SEN/tra6j4= X-Received: by 2002:a67:c90f:0:b0:398:8f83:e4d with SMTP id w15-20020a67c90f000000b003988f830e4dmr5552730vsk.24.1666042163594; Mon, 17 Oct 2022 14:29:23 -0700 (PDT) Received: from 480794996271 named unknown by gmailapi.google.com with HTTPREST; Mon, 17 Oct 2022 14:29:22 -0700 MIME-Version: 1.0 From: Simon Glass In-Reply-To: <69ad698a2db409376903f379e0c52bba1142af65.1665604425.git.msuchanek@suse.de> References: <69ad698a2db409376903f379e0c52bba1142af65.1665604425.git.msuchanek@suse.de> Date: Mon, 17 Oct 2022 14:29:22 -0700 X-Google-Sender-Auth: dIF45VW-5ZZvO8v0Kh38T8Iyz5s Message-ID: Subject: Re: [PATCH v6 05/20] usb: ether: Fix error handling in usb_ether_init To: Michal Suchanek Cc: Lukasz Majewski , Marek Vasut , Simon Glass , u-boot@lists.denx.de Content-Type: text/plain; charset="UTF-8" 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.6 at phobos.denx.de X-Virus-Status: Clean The code checks the return value from uclass_first_device as well as that the device exists but it passes on the return value which may be zero if there are no gadget devices. Just check that a device was returned and return -ENODEV otherwise. Also remove the dev variable which is not really used for anything. Signed-off-by: Michal Suchanek Reviewed-by: Simon Glass --- drivers/usb/gadget/ether.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) Applied to u-boot-dm, thanks!