From patchwork Mon Nov 30 01:53:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1407947 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: 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: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=UGBcwEw2; 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 RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CkpLm0Jcyz9sTc for ; Mon, 30 Nov 2020 12:59:11 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 797E3827E5; Mon, 30 Nov 2020 02:57:32 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (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=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="UGBcwEw2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 335C082785; Mon, 30 Nov 2020 02:55:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 28323827C8 for ; Mon, 30 Nov 2020 02:55:01 +0100 (CET) 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@chromium.org Received: by mail-io1-xd41.google.com with SMTP id q137so6589413iod.9 for ; Sun, 29 Nov 2020 17:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SXnInN5sSJs841YHZvYkgXoEtPxRyXFwjCWBWz1K8LQ=; b=UGBcwEw2VyWGqLqd3QoMY3+oLi+YQla7QizECEa9SV8yAmCf4iHrInoS3EdqRF4Wrh nf9BxLENMDtxHXXyS0UbkB95bKgIwLo20+OLf5i706h6jj11/qdj2/M1z8bu2bR2CaUi 3W4MNluB0q6yaMUtCjDgryjKPQtjQ94XC5q2c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SXnInN5sSJs841YHZvYkgXoEtPxRyXFwjCWBWz1K8LQ=; b=PKzm/5jXvQCWxBwNuwGJ2OhTNaBUd50n5mHVs1FKfiDxbDJMoJQoBO+vg0+iXlvn+e DG3r6yTa8lO3YielSnTp+4XjLjIuVKn8fSdUTWLIU0YeIT8UCMGcvl2zWHxqgQ537zSt ESU/wy3PBmmWMcIwF7tz8KnC9s2U8dOy5+xFIM8r6VijMSCLL9bgjJr+6G8gYpXLZ28x DmqhlvNM2OM6yy6c+SKbhtCQUsmVq8PKUzhx2QxQzctDimcp10KCCQrqjMkd0yG2lyun f1eK03NlyAPilNkBHDl60NdTodAqJyUd59/dbVgtK6aGiABVO8UKi+ZHSunUyxPoMMca lHpg== X-Gm-Message-State: AOAM530OKw+MeJY3kXT15vNGeHSTgkkx7MQsWEg/Uh4wbuCGNaEoQNAW qdYLWgkE/mjrodpmVgbLYDBBJD9aTO1GWg== X-Google-Smtp-Source: ABdhPJzKJB6mhqQutqIHS3V4cIythONsLHdvhtqpkBc6n2YYa/oQRIDJs5qvs8duuhKE8Hiwd0rh8w== X-Received: by 2002:a6b:760e:: with SMTP id g14mr13792431iom.136.1606701299746; Sun, 29 Nov 2020 17:54:59 -0800 (PST) Received: from localhost.localdomain (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id q5sm6543341ilg.62.2020.11.29.17.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 17:54:59 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Marek Vasut , Pavel Herrmann Subject: [PATCH 24/27] dm: core: Simplify uclass_find_next_free_req_seq() Date: Sun, 29 Nov 2020 18:53:59 -0700 Message-Id: <20201130015402.2328621-23-sjg@chromium.org> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog In-Reply-To: <20201130015402.2328621-1-sjg@chromium.org> References: <20201130015402.2328621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.3 at phobos.denx.de X-Virus-Status: Clean This function current deals with req_seq which is deprecated. Update it to use the new sequence numbers. Rename the function to make this clear. Signed-off-by: Simon Glass --- drivers/core/device.c | 7 +++---- drivers/core/uclass.c | 6 +++--- include/dm/uclass-internal.h | 14 +++++++------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index d57a8bc1343..d9648f9394e 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -94,16 +94,15 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv, if (dev->req_seq == -1) { auto_seq = true; dev->req_seq = - uclass_find_next_free_req_seq( - uc); + uclass_find_next_free_seq(uc); } } } else { auto_seq = true; - dev->req_seq = uclass_find_next_free_req_seq(uc); + dev->req_seq = uclass_find_next_free_seq(uc); } if (auto_seq && !(gd->flags & GD_FLG_DM_NO_SEQ)) - dev->sqq = uclass_find_next_free_req_seq(uc); + dev->sqq = uclass_find_next_free_seq(uc); } if (drv->platdata_auto_alloc_size) { diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 48d81221c38..8d5e92da288 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -272,14 +272,14 @@ int uclass_find_device_by_name(enum uclass_id id, const char *name, return -ENODEV; } -int uclass_find_next_free_req_seq(struct uclass *uc) +int uclass_find_next_free_seq(struct uclass *uc) { struct udevice *dev; int max = -1; list_for_each_entry(dev, &uc->dev_head, uclass_node) { - if ((dev->req_seq != -1) && (dev->req_seq > max)) - max = dev->req_seq; + if (dev->sqq != -1 && dev->sqq > max) + max = dev->sqq; } if (max == -1) diff --git a/include/dm/uclass-internal.h b/include/dm/uclass-internal.h index 9c23d3f223e..50431bd847c 100644 --- a/include/dm/uclass-internal.h +++ b/include/dm/uclass-internal.h @@ -12,17 +12,17 @@ #include /** - * uclass_find_next_free_req_seq() - Get the next free req_seq number + * uclass_find_next_free_seq() - Get the next free sequence number * - * This returns the next free req_seq number. This is useful only if - * OF_CONTROL is not used. The next free req_seq number is simply the - * maximum req_seq of the uclass + 1. - * This allows assiging req_seq number in the binding order. + * This returns the next free sequence number. This is useful only if + * OF_CONTROL is not used. The next free sequence number is simply the + * maximum sequence number used by al devices in the uclass + 1. + * This allows assiging the sequence number in the binding order. * * @uc: uclass to check - * @return The next free req_seq number + * @return The next free sequence number */ -int uclass_find_next_free_req_seq(struct uclass *uc); +int uclass_find_next_free_seq(struct uclass *uc); /** * uclass_get_device_tail() - handle the end of a get_device call