From patchwork Wed Jul 9 03:37:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 368065 X-Patchwork-Delegate: sjg@chromium.org 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 AAB91140087 for ; Wed, 9 Jul 2014 13:40:55 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 626AFAB5B9; Wed, 9 Jul 2014 05:40:42 +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 9KjSm5c-zirr; Wed, 9 Jul 2014 05:40:42 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA2AFAB5EC; Wed, 9 Jul 2014 05:39:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 848EEA74F2 for ; Wed, 9 Jul 2014 05:39:13 +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 otL40wi27e2u for ; Wed, 9 Jul 2014 05:39:10 +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-vc0-f201.google.com (mail-vc0-f201.google.com [209.85.220.201]) by theia.denx.de (Postfix) with ESMTPS id CC1F7AB5B7 for ; Wed, 9 Jul 2014 05:38:58 +0200 (CEST) Received: by mail-vc0-f201.google.com with SMTP id ij19so982341vcb.0 for ; Tue, 08 Jul 2014 20:38:57 -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=JmqR8KZm5eX0eqfP6Z8WaYtaKcgPsivEXGbFmAO2DgM=; b=hRUGjapjdGHLWMXWlgnZv+zOw1XW400nbPYLOVNsaDT7qp1DpJyDkR2Jd08Z2r6TJw dkOkcjEW9vwfk0CiUixhk3YSvRwv4+muhrH5uiiwP4pu1uodXyLfxeJV7hKSfR/HbNpS tOkhlA3EfQ008WoTf9vfJ/LjFhavtv96Xon7bqFltqv+A7bGICK7j1+xkv1QjC7ftNHf 7vYcJ/W3yXEc7thdZ9mG2MIPj0Am0W/b0nhq52nHNEpZVV1DnU7X64sNzwbiajzn1Nl3 1wvVvIhDpe1Vg5PQ1UYm9Ky2Y0Goy8Gty/PkgKjwvf6xHbGImJVFUMXh9IEB6LBeX7ZZ fRew== X-Gm-Message-State: ALoCoQkbTd4/Kag51st03NWY/7kdcD0sbpvEM7Sd7lEfB9fYcshwBX9kx8mMh/86OGYaQQX4PZb2 X-Received: by 10.58.48.194 with SMTP id o2mr18566847ven.16.1404877136001; Tue, 08 Jul 2014 20:38:56 -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 c50si2680553yhl.7.2014.07.08.20.38.55 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Jul 2014 20:38:55 -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 B61BF31C420; Tue, 8 Jul 2014 20:38:55 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 3671D22057F; Tue, 8 Jul 2014 21:38:55 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 8 Jul 2014 21:37:57 -0600 Message-Id: <1404877099-7314-8-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1404877099-7314-1-git-send-email-sjg@chromium.org> References: <1404877099-7314-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH v2 07/29] sandbox: Remove all drivers before exit 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 Drivers are supposed to be able to close down cleanly. To set a good example, make sandbox shut down its driver model drivers and remove them before exit. It may be desirable to do the same more generally once driver model is more widely-used. This could be done during bootm, before U-Boot jumps to the OS. It seems far too early to make this change. Signed-off-by: Simon Glass --- Changes in v2: None arch/sandbox/cpu/cpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c index 3f4005b..1aa397c 100644 --- a/arch/sandbox/cpu/cpu.c +++ b/arch/sandbox/cpu/cpu.c @@ -4,6 +4,7 @@ */ #include +#include #include #include @@ -14,6 +15,9 @@ void reset_cpu(ulong ignored) if (state_uninit()) os_exit(2); + if (dm_uninit()) + os_exit(2); + /* This is considered normal termination for now */ os_exit(0); }