From: Dragan Simic <dsimic@manjaro.org>
To: Caleb Connolly <caleb.connolly@linaro.org>
Cc: Christian Marangi <ansuelsmth@gmail.com>,
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>,
u-boot@lists.denx.de
Subject: Re: [PATCH] mmc: don't print 'MMC:' if there are no MMC devices
Date: Wed, 13 Nov 2024 10:48:29 +0100 [thread overview]
Message-ID: <50f69678f0fbb74aecc2e2aeb5f4dc6b@manjaro.org> (raw)
In-Reply-To: <20241113053023.1870736-1-caleb.connolly@linaro.org>
Hello Caleb,
Thanks for the patch. Please, see a comment below.
On 2024-11-13 06:30, Caleb Connolly wrote:
> 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 {
> 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;
> + }
Can't we simply check for "entry == &mmc_devices->next" here and
avoid the introduction of "first"?
> printf("%s: %d", m->cfg->name, m->block_dev.devnum);
> if (mmc_type)
> printf(" (%s)", mmc_type);
next prev parent reply other threads:[~2024-11-13 9:48 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 [this message]
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
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=50f69678f0fbb74aecc2e2aeb5f4dc6b@manjaro.org \
--to=dsimic@manjaro.org \
--cc=ansuelsmth@gmail.com \
--cc=caleb.connolly@linaro.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jerome.forissier@linaro.org \
--cc=jh80.chung@samsung.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox