From patchwork Fri Sep 6 11:51:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Fitzsimmons X-Patchwork-Id: 1158960 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=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=fitzsim.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=fitzsim-org.20150623.gappssmtp.com header.i=@fitzsim-org.20150623.gappssmtp.com header.b="p99TOgQS"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Pwsd4Qnqz9s7T for ; Fri, 6 Sep 2019 21:52:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B8229C21D8A; Fri, 6 Sep 2019 11:52:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A0D4DC21C50; Fri, 6 Sep 2019 11:52:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2C8F6C21E38; Fri, 6 Sep 2019 11:52:05 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id B450AC21DD9 for ; Fri, 6 Sep 2019 11:52:03 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id s21so12103888ioa.1 for ; Fri, 06 Sep 2019 04:52:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fitzsim-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OkmM78nfB39QQHdEcobh4Z0Ai7Ps6fBlBTpZ3P168pA=; b=p99TOgQSL9m+U5e3uPYbj4EMZ0LfzmqWtCWLGE+U03/89R7rx00ZRIQkPMTvH/77jR c+x11cJw+Y6Bv/9W7/5NgVRnqi3V299axQnFZLLF6WBpha09lFBUXuUVi0FopRuuHI8o BgAY7n/lVBbzBiYmiZ3ccXbfsTldFMb1vYcPdGLGVNuAAweKgzeTHWsrZTQ70rVOjN4D uhY1mTqCirssbsg/ZNtGQ07JRzyjlD5KP/X97KLYZFxBsH3q8OU48k27f2koUalACGRV 4eEo3qKrY2PmTH2TxnmJH8qlRBcD4OIDou7oeydT7IMn/y1I8JiTPfLnRk35hI/z0tH/ a+4w== 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=OkmM78nfB39QQHdEcobh4Z0Ai7Ps6fBlBTpZ3P168pA=; b=SZOHLtllzBfx45Y8iU3Qt46VOGw8fSbJoiVIl4FXh0Intqd4r+nLC+INthwgPYgLgL zszUQUyWacgdGVACn2G7q6X7YoUVZ10cAF0E19lUvx2ogPWIdYdSLwncxWVfqdHtWyfR Xm+MHjS7ScQXGu7Uahi53iklIrXu+70QeHmK6Z7s1U9VqYQAb6CiZxgU8DDODyH68M4l bT2g2Xv+7s+OPi1Ygie3GDSzyxZYeV07zR+5zWw9/OXBzr5yVJvmLdL3FpFHxR06qKEF 60ARIraijx4AqHYYrrFj2y0enF4hxFp+1N/GxckFe0bruhLqkpvzp/t8RcgfiY3ju63s nJAw== X-Gm-Message-State: APjAAAVOQduf0i7KECh7DYHRfwq0TWL95Q8zNAma0drUvRPoKKXks9QN mn9x3QEO6dtuHiaYBBYZqvqdnXUcCjZXM+LZ X-Google-Smtp-Source: APXvYqxGc1k5LJAlBR5vqIoO6zKU+GMw2MbSPZ5XP7aHfzhxGRVVO+e8Qx1rup7dIupU9SQ7StPeew== X-Received: by 2002:a5d:88ce:: with SMTP id i14mr9223043iol.307.1567770722488; Fri, 06 Sep 2019 04:52:02 -0700 (PDT) Received: from localhost.localdomain (69-165-165-189.dsl.teksavvy.com. [69.165.165.189]) by smtp.gmail.com with ESMTPSA id a7sm3893816iok.41.2019.09.06.04.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 04:52:02 -0700 (PDT) From: Thomas Fitzsimmons To: u-boot@lists.denx.de Date: Fri, 6 Sep 2019 07:51:18 -0400 Message-Id: <2c7c806ea271da383b3a9c1cf29dab965241fdac.1567769914.git.fitzsim@fitzsim.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: References: MIME-Version: 1.0 Cc: Stefan Roese , Tom Rini Subject: [U-Boot] [PATCH 1/2] dm: device: Request next sequence number X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" For CONFIG_OF_PRIOR_STAGE, in the absence of a device tree alias for a given device, use the next request number for that type of device. This allows aliases to be used when they're available, while still allowing unaliased devices to be probed. Signed-off-by: Thomas Fitzsimmons Cc: Bin Meng Cc: Simon Glass Reviewed-by: Simon Glass --- drivers/core/device.c | 5 +++++ drivers/core/uclass.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index 474c1642ee..ca8be208a9 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -82,6 +82,11 @@ static int device_bind_common(struct udevice *parent, const struct driver *drv, if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) { if (uc->uc_drv->name && ofnode_valid(node)) dev_read_alias_seq(dev, &dev->req_seq); +#if CONFIG_IS_ENABLED(OF_PRIOR_STAGE) + if (dev->req_seq == -1) + dev->req_seq = + uclass_find_next_free_req_seq(drv->id); +#endif } else { dev->req_seq = uclass_find_next_free_req_seq(drv->id); } diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index b33296542f..d7aedac351 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -269,7 +269,9 @@ int uclass_find_device_by_name(enum uclass_id id, const char *name, return -ENODEV; } -#if !CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_PLATDATA) +#if !CONFIG_IS_ENABLED(OF_CONTROL) || \ + CONFIG_IS_ENABLED(OF_PLATDATA) || \ + CONFIG_IS_ENABLED(OF_PRIOR_STAGE) int uclass_find_next_free_req_seq(enum uclass_id id) { struct uclass *uc;