summaryrefslogtreecommitdiff
path: root/cmd/usb_mass_storage.c
AgeCommit message (Collapse)AuthorFilesLines
2017-10-04treewide: replace with error() with pr_err()Masahiro Yamada1-3/+3
U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
2017-06-18cmd: usb_mass_storage: Staticize do_usb_mass_storage()Fabio Estevam1-1/+1
Make do_usb_mass_storage() static to fix the following sparse warning: cmd/usb_mass_storage.c:136:5: warning: symbol 'do_usb_mass_storage' was not declared. Should it be static? Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
2017-06-18cmd: usb_mass_storage: Use NULL for pointerFabio Estevam1-1/+1
Use NULL for pointer to fix the following sparse warning: cmd/usb_mass_storage.c:47:15: warning: Using plain integer as NULL pointer Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
2016-07-27dm: usb: Use blk_dread/write() instead of direct callsSimon Glass1-2/+2
Update the USB mass storage code to allow it to work with driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-04-20cmd/usb_mass_storage.c: Rework ums_init() ret logic slightlyTom Rini1-13/+5
Previously, ret could be used uninitialized if blk_get_device_part_str() failed. Default to ret being set to -1 so that we always return an err up if we have a problem and then invert the logic on testing ums_count as when that is non-zero is the time we can return 0. Cc: John Tobias <john.tobias.ph@gmail.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
2016-04-20usb: ums - expose selected partition/sJohn Tobias1-10/+29
By applying this patch, it will give us some flexibility to expose a selected partition/s. e.g: 1. To expose several partitions ums 0 mmc 0:1,0:6 2. To expose the all partitions ums 0 mmc 0:0 3. To expose multiple partititions on several devices ums 0 mmc 0:1,1:6 4. It support legacy format ums 0 mmc 0 Signed-off-by: John Tobias <john.tobias.ph@gmail.com>
2016-03-15dm: block: Rename device number member dev to devnumSimon Glass1-1/+1
This is a device number, and we want to use 'dev' to mean a driver model device. Rename the member. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-15dm: blk: Rename get_device() to blk_get_device_by_str()Simon Glass1-1/+1
The current name is too generic. The function returns a block device based on a provided string. Rename it to aid searching and make its purpose clearer. Also add a few comments. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-15dm: Drop the block_dev_desc_t typedefSimon Glass1-3/+3
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-01-25Remove the cmd_ prefix from command filesSimon Glass1-0/+235
Now that they are in their own directory, we can remove this prefix. This makes it easier to find a file since the prefix does not get in the way. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com>