| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright (C) 2016 Socionext Inc. |
| * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
| static int find_first_mmc_device(bool is_sd) |
| for (i = 0; (mmc = find_mmc_device(i)); i++) { |
| ((is_sd && IS_SD(mmc)) || (!is_sd && IS_MMC(mmc)))) |
| int mmc_get_env_dev(void) |
| return find_first_mmc_device(false); |
| static int do_mmcsetn(struct cmd_tbl *cmdtp, int flag, int argc, |
| dev = find_first_mmc_device(false); |
| env_set_ulong("mmc_first_dev", dev); |
| mmcsetn, 1, 1, do_mmcsetn, |
| "Set the first MMC (not SD) dev number to \"mmc_first_dev\" environment", |
| static int do_sdsetn(struct cmd_tbl *cmdtp, int flag, int argc, |
| dev = find_first_mmc_device(true); |
| env_set_ulong("sd_first_dev", dev); |
| "Set the first SD dev number to \"sd_first_dev\" environment", |