]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/mmc/mmc_boot.c
Merge git://git.denx.de/u-boot-mmc
[people/ms/u-boot.git] / drivers / mmc / mmc_boot.c
index 756a9824e3e41ddb09d9c55abd7824e8b8ce86dd..6d77ce95e7e2ecaf68a47411396eade2d39c2685 100644 (file)
@@ -85,16 +85,10 @@ int mmc_boot_partition_size_change(struct mmc *mmc, unsigned long bootsize,
  */
 int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode)
 {
-       int err;
-
-       err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_BUS_WIDTH,
-                        EXT_CSD_BOOT_BUS_WIDTH_MODE(mode) |
-                        EXT_CSD_BOOT_BUS_WIDTH_RESET(reset) |
-                        EXT_CSD_BOOT_BUS_WIDTH_WIDTH(width));
-
-       if (err)
-               return err;
-       return 0;
+       return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_BUS_WIDTH,
+                         EXT_CSD_BOOT_BUS_WIDTH_MODE(mode) |
+                         EXT_CSD_BOOT_BUS_WIDTH_RESET(reset) |
+                         EXT_CSD_BOOT_BUS_WIDTH_WIDTH(width));
 }
 
 /*
@@ -106,16 +100,19 @@ int mmc_set_boot_bus_width(struct mmc *mmc, u8 width, u8 reset, u8 mode)
  */
 int mmc_set_part_conf(struct mmc *mmc, u8 ack, u8 part_num, u8 access)
 {
-       int err;
+       int ret;
+       u8 part_conf;
 
-       err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
-                        EXT_CSD_BOOT_ACK(ack) |
-                        EXT_CSD_BOOT_PART_NUM(part_num) |
-                        EXT_CSD_PARTITION_ACCESS(access));
+       part_conf = EXT_CSD_BOOT_ACK(ack) |
+                   EXT_CSD_BOOT_PART_NUM(part_num) |
+                   EXT_CSD_PARTITION_ACCESS(access);
 
-       if (err)
-               return err;
-       return 0;
+       ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
+                        part_conf);
+       if (!ret)
+               mmc->part_config = part_conf;
+
+       return ret;
 }
 
 /*