From patchwork Tue Jan 23 20:17:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 865002 X-Patchwork-Delegate: trini@ti.com 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=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zR0C46R3Kz9s82 for ; Wed, 24 Jan 2018 07:24:32 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 9C211C22139; Tue, 23 Jan 2018 20:20:02 +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=none 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 77A3EC2214F; Tue, 23 Jan 2018 20:17:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AABAFC2214C; Tue, 23 Jan 2018 20:17:18 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id A089EC21E65 for ; Tue, 23 Jan 2018 20:17:13 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 7E62920D96; Tue, 23 Jan 2018 21:17:13 +0100 (CET) Received: from localhost (LFbn-1-2035-97.w90-76.abo.wanadoo.fr [90.76.104.97]) by mail.free-electrons.com (Postfix) with ESMTPSA id 4BD5920C29; Tue, 23 Jan 2018 21:17:13 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Tue, 23 Jan 2018 21:17:02 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Andre Przywara , agraf@suse.de, u-boot@lists.denx.de, Maxime Ripard , Jagan Teki Subject: [U-Boot] [PATCH v3 13/15] env: Mark env_get_location as weak 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Allow boards and architectures to override the default environment lookup code by overriding env_get_location. Reviewed-by: Andre Przywara Reviewed-by: Lukasz Majewski Reviewed-by: Simon Glass Signed-off-by: Maxime Ripard --- env/env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/env/env.c b/env/env.c index 2ea581cbedd6..9564522e76a5 100644 --- a/env/env.c +++ b/env/env.c @@ -85,6 +85,7 @@ static void env_set_inited(enum env_location location) * highest priority * * This will return the preferred environment for the given priority. + * This is overridable by boards if they need to. * * All implementations are free to use the operation, the priority and * any other data relevant to their choice, but must take into account @@ -95,7 +96,7 @@ static void env_set_inited(enum env_location location) * Returns: * an enum env_location value on success, a negative error code otherwise */ -static enum env_location env_get_location(enum env_operation op, int prio) +__weak enum env_location env_get_location(enum env_operation op, int prio) { switch (op) { case ENVOP_GET_CHAR: