From: "Jaehoon Chung" <jh80.chung@samsung.com>
To: "'Caleb Connolly'" <caleb.connolly@linaro.org>,
"'Christian Marangi'" <ansuelsmth@gmail.com>,
"'Dragan Simic'" <dsimic@manjaro.org>,
"'Ilias Apalodimas'" <ilias.apalodimas@linaro.org>,
"'Jerome Forissier'" <jerome.forissier@linaro.org>,
"'Jonas Karlman'" <jonas@kwiboo.se>,
"'Marek Vasut'" <marek.vasut+renesas@mailbox.org>,
"'Peng Fan'" <peng.fan@nxp.com>,
"'Peter Robinson'" <pbrobinson@gmail.com>,
"'Rasmus Villemoes'" <rasmus.villemoes@prevas.dk>,
"'Simon Glass'" <sjg@chromium.org>,
"'Sughosh Ganu'" <sughosh.ganu@linaro.org>,
"'Tom Rini'" <trini@konsulko.com>
Cc: <u-boot@lists.denx.de>
Subject: RE: [PATCH] mmc: don't print 'MMC:' if there are no MMC devices
Date: Thu, 14 Nov 2024 15:54:30 +0900 [thread overview]
Message-ID: <12cb01db3662$0df6e1e0$29e4a5a0$@samsung.com> (raw)
In-Reply-To: <20241113053023.1870736-1-caleb.connolly@linaro.org>
Hi,
> -----Original Message-----
> From: Caleb Connolly <caleb.connolly@linaro.org>
> Sent: Wednesday, November 13, 2024 2:30 PM
> To: Caleb Connolly <caleb.connolly@linaro.org>; Christian Marangi <ansuelsmth@gmail.com>; Dragan Simic
> <dsimic@manjaro.org>; Ilias Apalodimas <ilias.apalodimas@linaro.org>; Jaehoon Chung
> <jh80.chung@samsung.com>; Jerome Forissier <jerome.forissier@linaro.org>; Jonas Karlman
> <jonas@kwiboo.se>; Marek Vasut <marek.vasut+renesas@mailbox.org>; Peng Fan <peng.fan@nxp.com>; Peter
> Robinson <pbrobinson@gmail.com>; Rasmus Villemoes <rasmus.villemoes@prevas.dk>; Simon Glass
> <sjg@chromium.org>; Sughosh Ganu <sughosh.ganu@linaro.org>; Tom Rini <trini@konsulko.com>
> Cc: u-boot@lists.denx.de
> Subject: [PATCH] mmc: don't print 'MMC:' if there are no MMC devices
>
> It may be the case that MMC support is enabled even though the board
> we're booting on doesn't have any MMC devices. Move the print over to
> the print_mmc_devices() function where we can only print it if we
> actually have MMC devices.
>
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
> common/board_r.c | 1 -
> drivers/mmc/mmc-uclass.c | 4 +++-
> drivers/mmc/mmc_legacy.c | 5 +++++
> 3 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/common/board_r.c b/common/board_r.c
> index 62228a723e12..232a8fd19f03 100644
> --- a/common/board_r.c
> +++ b/common/board_r.c
> @@ -384,9 +384,8 @@ static int initr_onenand(void)
>
> #ifdef CONFIG_MMC
> static int initr_mmc(void)
> {
> - puts("MMC: ");
> mmc_initialize(gd->bd);
> return 0;
> }
> #endif
> diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
> index c8db4f811c2f..56fe29249c36 100644
> --- a/drivers/mmc/mmc-uclass.c
> +++ b/drivers/mmc/mmc-uclass.c
> @@ -384,9 +384,11 @@ void print_mmc_devices(char separator)
> dev;
> uclass_next_device(&dev), first = false) {
> struct mmc *m = mmc_get_mmc_dev(dev);
>
> - if (!first) {
> + if (first) {
> + printf("MMC: ");
> + } else {
Frankly, I don't know if it needs to print "MMC; " at here.
It's already knowing mmc with mmc command. In board_r, To clarify which device is showing "MMC", but not here.
Best Regards,
Jaehoon Chung
> printf("%c", separator);
> if (separator != '\n')
> puts(" ");
> }
> diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
> index 8f8ba34be717..f4a049a4a4d4 100644
> --- a/drivers/mmc/mmc_legacy.c
> +++ b/drivers/mmc/mmc_legacy.c
> @@ -98,8 +98,9 @@ void print_mmc_devices(char separator)
> {
> struct mmc *m;
> struct list_head *entry;
> char *mmc_type;
> + bool first = true;
>
> list_for_each(entry, &mmc_devices) {
> m = list_entry(entry, struct mmc, link);
>
> @@ -107,8 +108,12 @@ void print_mmc_devices(char separator)
> mmc_type = IS_SD(m) ? "SD" : "eMMC";
> else
> mmc_type = NULL;
>
> + if (first) {
> + printf("MMC: ");
> + first = false;
> + }
> printf("%s: %d", m->cfg->name, m->block_dev.devnum);
> if (mmc_type)
> printf(" (%s)", mmc_type);
>
> --
> 2.47.0
prev parent reply other threads:[~2024-11-14 6:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20241113053033epcas1p2f8d1ef98103f17f5442279ac21a898fc@epcas1p2.samsung.com>
2024-11-13 5:30 ` [PATCH] mmc: don't print 'MMC:' if there are no MMC devices Caleb Connolly
2024-11-13 7:43 ` Ilias Apalodimas
2024-11-13 9:48 ` Dragan Simic
2024-11-13 13:08 ` Caleb Connolly
2024-11-13 13:15 ` Dragan Simic
2024-11-13 14:24 ` Tom Rini
2024-11-13 14:47 ` Caleb Connolly
2024-11-14 7:34 ` Jaehoon Chung
2024-11-14 18:02 ` Tom Rini
2024-11-14 18:05 ` Caleb Connolly
2024-11-14 6:54 ` Jaehoon Chung [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='12cb01db3662$0df6e1e0$29e4a5a0$@samsung.com' \
--to=jh80.chung@samsung.com \
--cc=ansuelsmth@gmail.com \
--cc=caleb.connolly@linaro.org \
--cc=dsimic@manjaro.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=jonas@kwiboo.se \
--cc=marek.vasut+renesas@mailbox.org \
--cc=pbrobinson@gmail.com \
--cc=peng.fan@nxp.com \
--cc=rasmus.villemoes@prevas.dk \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.