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: 125575 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1983193ljf; Tue, 23 Jan 2018 12:21:31 -0800 (PST) X-Google-Smtp-Source: AH8x2256OzMUmTbO8V50owH6fIPbvq4V8SP1k6YTwuaI+tI/GooXPs6+TpWGXaA6eDg3aO7owEmy X-Received: by 10.80.224.5 with SMTP id e5mr21296588edl.218.1516738891045; Tue, 23 Jan 2018 12:21:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516738891; cv=none; d=google.com; s=arc-20160816; b=guBUt/ow0zWjK3muC5JqjIjqnNBSZJhxaPiBkWapVEfYPjoFHvm2H/P1MYYg3zkFso sdYOx9CoxK8ryyejFgOs7evc1kcXJCZy2d4VpUXd3/KrPL0ogk0tdLy2VCa9YuOsATtN fIWub5aE06wyQ2tQX1q+MLMj8b75nH4m+A81wki4lJRq5IzueNXrLpxAh8xs5T4b6ZnB vPcEIX1OfHvr1RuQ3qXB4W5iaFxCPzPJmtNRwMxyr05Avt97obtfE030EVlskc4hJHYz WJCGgxosJRSx15p5PkBrt3MeCo1dDAReqtzKrlO7ztdJK0wiLhc7ljAu87Xm7QxtG/So FVoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:arc-authentication-results; bh=EA9Y54WHJLs6l250WpetDWn6kwPY3p4tSfQZfVhVS3o=; b=F8AWMnq5jpso/QQ486EvKYwsIwU4oDsuQRjQkWw68/mPvHydnWzNVFbRvGrJlNG2ek fFIC61+PalMAaK9y/qII6hGlzYWL0jPYWh54GAx22mvwK/0d+YLDGBTZ2i7vjFCe7+Hg D9n1aFpJCelOa/BqO2JEipX4rcBH1WTIwUUvTFfyA31ATp6naYsZe3AiOmoWj1DI4wfS pCPIIBt85PqkAuFo7TjM9jZKYp4gRpaqGcoQajdy9yQ01OTmTIZ8ZfWzly9EtEux+j1R RDBu+qdnSiPSsBdYZaXORN1lwWwnsVFvqdpmAUSLcsD9OZ/1zLltbQwEquu19sdZoSns G8sQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id a4si1083311ede.313.2018.01.23.12.21.30; Tue, 23 Jan 2018 12:21:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 96C22C220DC; Tue, 23 Jan 2018 20:20:01 +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: