From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 883DBC433F5 for ; Wed, 13 Oct 2021 15:46:42 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03BAB610FE for ; Wed, 13 Oct 2021 15:46:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 03BAB610FE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E7819835C9; Wed, 13 Oct 2021 17:46:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="U8W2mZiq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3B0C3835DE; Wed, 13 Oct 2021 17:46:12 +0200 (CEST) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6A1A5835B0 for ; Wed, 13 Oct 2021 17:46:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 491DB610FE; Wed, 13 Oct 2021 15:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634139964; bh=fgGxCs/Z/rpyWetcdPTuKDOcZ3Fe2fyU5Pe9kue781U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U8W2mZiqpbsjfIrb+tGACxcTLc4HlSL45JQ/QwF8mqape5Bhz+pVkqHla9+F2bieD sq+qNMr1E9STkWJvrz9xjUFnsbBMziZh9Re4/lzClxoSnbbH3ile0FBWYmJiwyZRie wBQ8EJqOai8pFIwwN4h7AVb6ZOp2VyH5GyGQVr5hu5JzT4cwuf8FskJlN2L6PJdrxK E08aJ83DxTURv+H728b9v9yaNPzIuoy7n1BC8yLz3P9tFEZHmMKo9/+vkCqpXmDgn2 tsvylqCWtkbq7b1Mqh7sumehg4AsXLXAeK4z33vZKhSsZjjc5KtLDjqu6+gCXhLaBF T0vo3rC2VCL+w== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Simon Glass , Tom Rini Cc: U-Boot Mailing List , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH v2 02/13] env: Drop env_get_char_spec() and old, unused .get_char() implementations Date: Wed, 13 Oct 2021 17:45:46 +0200 Message-Id: <20211013154557.28479-3-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211013154557.28479-1-kabel@kernel.org> References: <20211013154557.28479-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean From: Marek BehĂșn Commit b2cdef4861be ("env: restore old env_get_char() behaviour") dropped the .get_char() method from struct env_driver, but left the two existing implementations (eeprom and nvram) in case someone would use them by overwriting weak function env_get_char_spec(). Since this was never done in the 3.5 years, let's drop these methods and simplify the code. Signed-off-by: Marek BehĂșn --- env/eeprom.c | 18 ------------------ env/env.c | 7 +------ env/nvram.c | 14 -------------- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/env/eeprom.c b/env/eeprom.c index 253bdf1428..f8556a4721 100644 --- a/env/eeprom.c +++ b/env/eeprom.c @@ -64,24 +64,6 @@ static int eeprom_bus_write(unsigned dev_addr, unsigned offset, return rcode; } -/** Call this function from overridden env_get_char_spec() if you need - * this functionality. - */ -int env_eeprom_get_char(int index) -{ - uchar c; - unsigned int off = CONFIG_ENV_OFFSET; - -#ifdef CONFIG_ENV_OFFSET_REDUND - if (gd->env_valid == ENV_REDUND) - off = CONFIG_ENV_OFFSET_REDUND; -#endif - eeprom_bus_read(CONFIG_SYS_I2C_EEPROM_ADDR, - off + index + offsetof(env_t, data), &c, 1); - - return c; -} - static int env_eeprom_load(void) { char buf_env[CONFIG_ENV_SIZE]; diff --git a/env/env.c b/env/env.c index e534008006..91d220c3dd 100644 --- a/env/env.c +++ b/env/env.c @@ -166,17 +166,12 @@ static struct env_driver *env_driver_lookup(enum env_operation op, int prio) return drv; } -__weak int env_get_char_spec(int index) -{ - return *(uchar *)(gd->env_addr + index); -} - int env_get_char(int index) { if (gd->env_valid == ENV_INVALID) return default_environment[index]; else - return env_get_char_spec(index); + return *(uchar *)(gd->env_addr + index); } int env_load(void) diff --git a/env/nvram.c b/env/nvram.c index f4126858b5..261b31edfb 100644 --- a/env/nvram.c +++ b/env/nvram.c @@ -42,20 +42,6 @@ extern void nvram_write(long dest, const void *src, size_t count); static env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; #endif -#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE -/** Call this function from overridden env_get_char_spec() if you need - * this functionality. - */ -int env_nvram_get_char(int index) -{ - uchar c; - - nvram_read(&c, CONFIG_ENV_ADDR + index, 1); - - return c; -} -#endif - static int env_nvram_load(void) { char buf[CONFIG_ENV_SIZE]; -- 2.32.0