Re: [U-Boot] [PATCH 4/4] cmd_mmc: use new mmc_select_hwpart() function

2014-05-23 Thread Pantelis Antoniou
Hi Stephen,

On May 7, 2014, at 9:19 PM, Stephen Warren wrote:

 From: Stephen Warren swar...@nvidia.com
 
 The implementation of mmc_select_hwpart() was cribbed from do_mmcops().
 Update do_mmcops() to call mmc_select_hwpart() to avoid duplication.
 
 Signed-off-by: Stephen Warren swar...@nvidia.com
 ---
 common/cmd_mmc.c | 19 +--
 1 file changed, 5 insertions(+), 14 deletions(-)
 
 diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
 index c1916c9b56a6..572aa895fa1c 100644
 --- a/common/cmd_mmc.c
 +++ b/common/cmd_mmc.c
 @@ -193,7 +193,7 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
   print_mmc_devices('\n');
   return 0;
   } else if (strcmp(argv[1], dev) == 0) {
 - int dev, part = -1;
 + int dev, part = -1, ret;
   struct mmc *mmc;
 
   if (argc == 2)
 @@ -219,20 +219,11 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
 
   mmc_init(mmc);
   if (part != -1) {
 - int ret;
 - if (mmc-part_config == MMCPART_NOAVAILABLE) {
 - printf(Card doesn't support part_switch\n);
 + ret = mmc_select_hwpart(dev, part);
 + printf(switch to partitions #%d, %s\n,
 +part, (!ret) ? OK : ERROR);
 + if (ret)
   return 1;
 - }
 -
 - if (part != mmc-part_num) {
 - ret = mmc_switch_part(dev, part);
 - if (!ret)
 - mmc-part_num = part;
 -
 - printf(switch to partitions #%d, %s\n,
 - part, (!ret) ? OK : ERROR);
 - }
   }
   curr_device = dev;
   if (mmc-part_config == MMCPART_NOAVAILABLE)
 -- 
 1.8.1.5
 

Due to patch order mangling, I've applied but with some manual placement. 
Please verify that
it works properly on your end after the patches land at u-boot-mmc.

Thanks

-- Pantelis

Acked-by: Pantelis Antoniou pa...@antoniou-consulting.com

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] cmd_mmc: use new mmc_select_hwpart() function

2014-05-23 Thread Stephen Warren
On 05/23/2014 03:24 AM, Pantelis Antoniou wrote:
 Hi Stephen,
 
 On May 7, 2014, at 9:19 PM, Stephen Warren wrote:
 
 From: Stephen Warren swar...@nvidia.com

 The implementation of mmc_select_hwpart() was cribbed from do_mmcops().
 Update do_mmcops() to call mmc_select_hwpart() to avoid duplication.

 Due to patch order mangling, I've applied but with some manual placement. 
 Please verify that
 it works properly on your end after the patches land at u-boot-mmc.

I think this looks fine, thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 4/4] cmd_mmc: use new mmc_select_hwpart() function

2014-05-07 Thread Stephen Warren
From: Stephen Warren swar...@nvidia.com

The implementation of mmc_select_hwpart() was cribbed from do_mmcops().
Update do_mmcops() to call mmc_select_hwpart() to avoid duplication.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
 common/cmd_mmc.c | 19 +--
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index c1916c9b56a6..572aa895fa1c 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -193,7 +193,7 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
print_mmc_devices('\n');
return 0;
} else if (strcmp(argv[1], dev) == 0) {
-   int dev, part = -1;
+   int dev, part = -1, ret;
struct mmc *mmc;
 
if (argc == 2)
@@ -219,20 +219,11 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[])
 
mmc_init(mmc);
if (part != -1) {
-   int ret;
-   if (mmc-part_config == MMCPART_NOAVAILABLE) {
-   printf(Card doesn't support part_switch\n);
+   ret = mmc_select_hwpart(dev, part);
+   printf(switch to partitions #%d, %s\n,
+  part, (!ret) ? OK : ERROR);
+   if (ret)
return 1;
-   }
-
-   if (part != mmc-part_num) {
-   ret = mmc_switch_part(dev, part);
-   if (!ret)
-   mmc-part_num = part;
-
-   printf(switch to partitions #%d, %s\n,
-   part, (!ret) ? OK : ERROR);
-   }
}
curr_device = dev;
if (mmc-part_config == MMCPART_NOAVAILABLE)
-- 
1.8.1.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot