Remove redundant check from nand ubinized sysupgrade code. This check
has already been done in the only caller of the affected function:
nand_do_upgrade.
Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
local ubi_file="$1"
local mtdnum="$(find_mtd_index "$CI_UBIPART")"
- [ ! "$mtdnum" ] && {
- CI_UBIPART="rootfs"
- mtdnum="$(find_mtd_index "$CI_UBIPART")"
- }
-
if [ ! "$mtdnum" ]; then
echo "cannot find mtd device $CI_UBIPART"
umount -a
fi
local mtddev="/dev/mtd${mtdnum}"
- ubidetach -p "${mtddev}" || true
+ ubidetach -p "${mtddev}" || :
sync
ubiformat "${mtddev}" -y -f "${ubi_file}"
ubiattach -p "${mtddev}"
+
nand_do_upgrade_success
}
nand_do_upgrade() {
local file_type=$(identify $1)
- [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs"
+ [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART=rootfs
case "$file_type" in
"fit") nand_upgrade_fit $1;;