From: Tom Rini Date: Thu, 17 Dec 2015 19:27:53 -0500 Subject: [U-Boot] [PATCH 2/3] mmc: store hwpart in the block device In-Reply-To: <1449513530-14504-2-git-send-email-swarren@wwwdotorg.org> References: <1449513530-14504-1-git-send-email-swarren@wwwdotorg.org> <1449513530-14504-2-git-send-email-swarren@wwwdotorg.org> Message-ID: <20151218002753.GC11783@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Dec 07, 2015 at 11:38:49AM -0700, Stephen Warren wrote: > From: Stephen Warren > > This will allow us to have multiple block device structs each referring > to the same eMMC device, yet different HW partitions. > > For now, there is still a single block device per eMMC device. As before, > this block device always accesses whichever HW partition was most recently > selected. Clients wishing to make use of multiple block devices referring > to different HW partitions can simply take a copy of this block device > once it points at the correct HW partition, and use each one as they wish. > This feature will be used by the next patch. > > In the future, perhaps get_device() could be enhanced to return a > dynamically allocated block device struct, to avoid the client needing to > copy it in order to maintain multiple block devices. However, this would > require all users to be updated to free those block device structs at some > point, which is rather a large change. > > Most callers of mmc_switch_part() wish to permanently switch the default > MMC block device's HW partition. Enhance mmc_switch_part() so that it does > this. This removes the need for callers to do this. However, > common/env_mmc.c needs to save and restore the current HW partition. Make > it do this more explicitly. > > Replace use of mmc_switch_part() with mmc_select_hwpart() in order to > remove duplicate code that skips the call if that HW partition is already > selected. > > Signed-off-by: Stephen Warren Reviewed-by: Tom Rini -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: