From: Thomas Chou Date: Mon, 3 May 2010 08:54:44 +0800 Subject: [U-Boot] [PATCH 2/3] mmc: add find_mmc_device_quiet that doesnt print not found message In-Reply-To: <1271991214-7937-1-git-send-email-thomas@wytron.com.tw> References: <1271991214-7937-1-git-send-email-thomas@wytron.com.tw> Message-ID: <1272848085-10698-3-git-send-email-thomas@wytron.com.tw> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de We need to query mmc devices in mmc_spi subcommand and don't want the "Device not found" message. Signed-off-by: Thomas Chou --- drivers/mmc/mmc.c | 14 +++++++++++--- include/mmc.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index cf4ea16..55ab13e 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -60,7 +60,7 @@ int mmc_set_blocklen(struct mmc *mmc, int len) return mmc_send_cmd(mmc, &cmd, NULL); } -struct mmc *find_mmc_device(int dev_num) +struct mmc *find_mmc_device_quiet(int dev_num) { struct mmc *m; struct list_head *entry; @@ -72,11 +72,19 @@ struct mmc *find_mmc_device(int dev_num) return m; } - printf("MMC Device %d not found\n", dev_num); - return NULL; } +struct mmc *find_mmc_device(int dev_num) +{ + struct mmc *m = find_mmc_device_quiet(dev_num); + + if (!m) + printf("MMC Device %d not found\n", dev_num); + + return m; +} + static ulong mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, const void*src) { diff --git a/include/mmc.h b/include/mmc.h index 8973bc7..b24b596 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -270,6 +270,7 @@ int mmc_register(struct mmc *mmc); int mmc_initialize(bd_t *bis); int mmc_init(struct mmc *mmc); int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size); +struct mmc *find_mmc_device_quiet(int dev_num); struct mmc *find_mmc_device(int dev_num); void print_mmc_devices(char separator); int board_mmc_getcd(u8 *cd, struct mmc *mmc); -- 1.6.6.1