From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Fri, 17 Jan 2014 12:34:04 -0700 Subject: [U-Boot] [PATCH v2 1/2] env_mmc: make board configurable the partition for the environment In-Reply-To: <1389950098-18122-1-git-send-email-hector.palacios@digi.com> References: <1389950098-18122-1-git-send-email-hector.palacios@digi.com> Message-ID: <52D985AC.2010702@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 01/17/2014 02:14 AM, Hector Palacios wrote: > This complements commit 9404a5fc7cb58 "env_mmc: allow environment to be > in an eMMC partition" by allowing boards to accommodate the partition > to use for the environment in different scenarios (similarly to what is > done with the mmc dev number). Depending on the detected boot media, > boards may decide to store the environment in a different partition. > > The __weak function also allows to remove some ifdefs from the code. > If CONFIG_SYS_MMC_ENV_PART is not defined, partition 0 is assumed > (default value for U-Boot when a partition is not provided). > diff --git a/common/env_mmc.c b/common/env_mmc.c > __weak int mmc_get_env_devno(void) > { > return CONFIG_SYS_MMC_ENV_DEV; > + > +#if !defined(CONFIG_SYS_MMC_ENV_PART) Isn't the trailing } for that function missing? > +#define CONFIG_SYS_MMC_ENV_PART 0 > +#endif > + > +__weak int mmc_get_env_partno(void) > +{ > + return CONFIG_SYS_MMC_ENV_PART; > }