From patchwork Sat May 24 21:21:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 352177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2EA43140086 for ; Sun, 25 May 2014 07:25:44 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 49EB94B658; Sat, 24 May 2014 23:25:11 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 38PIPVLOFXFH; Sat, 24 May 2014 23:25:11 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9E5194B6C6; Sat, 24 May 2014 23:23:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EF4C54B690 for ; Sat, 24 May 2014 23:22:54 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DdFrzWZXd-cO for ; Sat, 24 May 2014 23:22:51 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qc0-f201.google.com (mail-qc0-f201.google.com [209.85.216.201]) by theia.denx.de (Postfix) with ESMTPS id 1F5954B672 for ; Sat, 24 May 2014 23:22:03 +0200 (CEST) Received: by mail-qc0-f201.google.com with SMTP id l6so1095556qcy.0 for ; Sat, 24 May 2014 14:22:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=un98TGZwJ8uxFVbLWVWH7Qa8VazELnjYhkcHIjIayro=; b=UIiOXn6QCfZ+6mO3w/+ec1qmfP+ypoI6d0L5T7R7dGenea3629ZXnHKVWIO8rrCjYM /nDCGUMvsKbmVzXpRAM96a8rWnIdqEI5uJ+vS3e2L1z56NYLhxqk/au1G/ePYJ5VUqcK qPioZOwxilk8J/tbRlD0RrZnuyCmmKz5rmM/nvSSZNY8DgkuTxu6QkBKTK2EpRDWJtkW NvOKvL8GgO8F/pagyAl3AqWHf/mlP5ZBm0AKRZKS2IwpxbVDc/RqeYEXUHs0BrX0tHPy MDC9vtKqfpYSfFaxqWcw+4TaOxY9BoRShI7AXG5yTMAI/rDWDUmaNRJCuZFGfYeTbCWi 9z1Q== X-Gm-Message-State: ALoCoQkHFBoxd/yBtNWbJqPzaO/IUqZl3an6EemG+F6u6uFQfUZsFKir3z8dWwUtTv8tyo2NiQ5c X-Received: by 10.52.12.33 with SMTP id v1mr5402467vdb.5.1400966521028; Sat, 24 May 2014 14:22:01 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id i65si217040yhg.2.2014.05.24.14.22.01 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 24 May 2014 14:22:01 -0700 (PDT) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id DE86B31D3EF; Sat, 24 May 2014 14:22:00 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 89361221141; Sat, 24 May 2014 15:22:00 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 May 2014 15:21:02 -0600 Message-Id: <1400966481-14131-4-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.9.1.423.g4596e3a In-Reply-To: <1400966481-14131-1-git-send-email-sjg@chromium.org> References: <1400966481-14131-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [RFC PATCH 03/22] dm: Make sure that the root device is probed X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The root device should be probed just like any other device. The effect of this is to mark the device as activated, so that it can be removed (along with its children) if required. Signed-off-by: Simon Glass Acked-by: Marek Vasut --- drivers/core/root.c | 3 +++ test/dm/core.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/core/root.c b/drivers/core/root.c index 4427b81..9fff164 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -48,6 +48,9 @@ int dm_init(void) ret = device_bind_by_name(NULL, &root_info, &DM_ROOT()); if (ret) return ret; + ret = device_probe(DM_ROOT()); + if (ret) + return ret; return 0; } diff --git a/test/dm/core.c b/test/dm/core.c index 14a57c3..a889fad 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -106,7 +106,7 @@ static int dm_test_autoprobe(struct dm_test_state *dms) ut_asserteq(0, dm_testdrv_op_count[DM_TEST_OP_POST_PROBE]); /* The root device should not be activated until needed */ - ut_assert(!(dms->root->flags & DM_FLAG_ACTIVATED)); + ut_assert(dms->root->flags & DM_FLAG_ACTIVATED); /* * We should be able to find the three test devices, and they should