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 5A12EC433FE for ; Mon, 17 Oct 2022 21:34:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C0E9484F98; Mon, 17 Oct 2022 23:31: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="HptyRUF2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E21E584F9E; Mon, 17 Oct 2022 23:30:19 +0200 (CEST) Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (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 0AA1884F90 for ; Mon, 17 Oct 2022 23:30:13 +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-oi1-x22e.google.com with SMTP id x188so13621392oig.5 for ; Mon, 17 Oct 2022 14:30:12 -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=P1HTFicxu0MaphaECK+Pe1Zjpw6RP7kQrHnENjI2skY=; b=HptyRUF2tiXqylmAU5DkYUzVX8V6IKX5BYzWxFxr51RTbl9fJOwDwBsLiCUmi4raYR Ntrjm++J4lHxhwtucOSce6pUYtaN7oAI+amA37KuTctreEcTKf7n67/Lf0wGo3/20eSU cL8yWjxVUZfViNvURBvmU45sjR1Uvb8lok9Ac= 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=P1HTFicxu0MaphaECK+Pe1Zjpw6RP7kQrHnENjI2skY=; b=63gGtpdEMkwAuwisiqw4Lv9Y1DEnU8WWpZbOSdvF+nJXW1HOEXHHFK2q9eisk6XzE6 d5ZyHSAW0MN08ryrpPLXezVLv+tfsHNJ63kCqeX+npIBETQJw5YUc7Tpd9QfyZKqD1Bd id5LsSSqh2VvdHQnoEjvI93khc/qnKENqDHda57iGPJ3+0C+IS413g0iJVv/4ksoHYvN qFmvq/6zmjkoFIUW2CnPysPbAyEvy8UR6qfaBL1yciDqWbG+XPS/6i+KVJ50ee/U0PV3 Lml+sFdcdwjls8K9+/+7oJ1ciqexGlmEnHl+nG0FPVyxx1VqCdvvRK6tmuss1dnqdV/h E09g== X-Gm-Message-State: ACrzQf1QVSbFrLEecuPDUb4LGhZVaR0Smsm5mBw36V/4AXA3FJWe6OUD dV0zEdqYGTKqHp4hyQRjFwhzRaLaF9/DXlutGEdF7Q== X-Google-Smtp-Source: AMsMyM4jYX6LA4LETJewi5GrKKxUeu0Hn1VlHWPN+LKrtdX8IxL7mtsQkhsTc6sWWiaOi7YtxYeDLgoS+TdkXKXVDcg= X-Received: by 2002:a05:6808:200c:b0:355:454b:5ae7 with SMTP id q12-20020a056808200c00b00355454b5ae7mr763118oiw.64.1666042211355; Mon, 17 Oct 2022 14:30:11 -0700 (PDT) Received: from 480794996271 named unknown by gmailapi.google.com with HTTPREST; Mon, 17 Oct 2022 14:29:25 -0700 MIME-Version: 1.0 From: Simon Glass In-Reply-To: <33c1a8167cd2f6ab007c4b37b0cb765c2042c814.1665604425.git.msuchanek@suse.de> References: <33c1a8167cd2f6ab007c4b37b0cb765c2042c814.1665604425.git.msuchanek@suse.de> Date: Mon, 17 Oct 2022 14:29:25 -0700 X-Google-Sender-Auth: GMwW0XCYZdbbBd80AVWDhs0dxOw Message-ID: Subject: Re: [PATCH v6 03/20] dm: pci: Fix device PCI iteration To: Michal Suchanek Cc: Andrew Scull , Bin Meng , Stefan Roese , Simon Glass , =?UTF-8?Q?Pali_Roh=C3=A1r?= , =?UTF-8?Q?Pierre=2DCl=C3=A9ment_Tosi?= , 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 When there is no PCI bus uclass_first_device will return no bus and no error which will result in pci_find_first_device calling skip_to_next_device with no bus, and the bus is only checked at the end of the while cycle, not the beginning. Fixes: 76c3fbcd3d ("dm: pci: Add a way to iterate through all PCI devices") Signed-off-by: Michal Suchanek Reviewed-by: Simon Glass --- v6: Move dropping the use of uclass iterator return value to later patch --- drivers/pci/pci-uclass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Applied to u-boot-dm, thanks!