From patchwork Wed Nov 13 05:30:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 842878 Delivered-To: patch@linaro.org Received: by 2002:a5d:6392:0:b0:381:e71e:8f7b with SMTP id p18csp30209wru; Tue, 12 Nov 2024 21:30:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWO4LTzPprjyfaAyG8tFq9vTDM3GF1kbNNnvjsWhWQnj59EVfkX3NKbGpzGqyLpX+iqJOM+fQ==@linaro.org X-Google-Smtp-Source: AGHT+IGqJ+duBOTCtP/cSo+Gl7WwQpi8mt/C8OR38Df3DTna82ebz+uiTRIX8FDqkKIZ39eaIFQE X-Received: by 2002:a05:6402:42c7:b0:5cf:5fe5:9977 with SMTP id 4fb4d7f45d1cf-5cf630b71d0mr1245519a12.5.1731475831980; Tue, 12 Nov 2024 21:30:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731475831; cv=none; d=google.com; s=arc-20240605; b=ZQ621W/cS2O6I19KZwSvW5HinOOqV91JZP4Zyagmb8LKzH27VRs9ZEGa/ceORK8Z0B iKeXqG6z2RPjhLUB/LaXQCd8wZNYtHr/1eKh8NqUm3erhEqxyQkcVlV/IJe6CFUcUQTF 6NZweZdC2gaGiCPT5Du9KS4HOxB5W9WcsWuf5f25negOmw+0rhL5kbz4G3LbWsv1oAGD wFNrb4xkdMKziwrSrXYlM3b/8KQJuAag+lJrJ9JekLTS1vqOTpNsAtB7UMxpwzInB7So s5qpchiL2d1Vf/z3/hdWNFs8sdYSRObO9HIuT5kjh3+w6VpKTFmHcjWEH/Ptoc2lS3c0 sRow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=DKrJbpWRaDd1GYUijQZs/ag6OlEvE2Rs3FfpeY/pjOY=; fh=dsSbsXzJSZlVMqPJiCdL/yRQaIkJomdz67n4JxNMmXY=; b=byfvcUpxEQjS9SrrLR3HvcbhkwbhHZixpSS5PJcl7A4d4lwtHDOv9SqjSoDVoBabOO l03WripZEp4Tr1P206oKx3TkHSzUzeYYEszaZEfkcnTPBB+MQYfzrwwbZs3MIQ4LveN5 TM4b5adkGp+jfpVe546qZisknrHKUBBDbhdqr07S91xziAJ4g1nto3Ho8FlBo2kYqZ8r 0ZcGD7wqJhMgqmt3IiO0j31QOfa/9hoq3fNdmlxqU5JAA85gfx57oGp/JEGiKywEg8ee sK7GwP9mSq9LAiuYjwJFXsWdYDfI/vWzxFkMB+7QzW+fGphWZw3xL5DEi5dKbI2YnmzY /lvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=byii2hdu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5cf03cfb6fcsi8968569a12.589.2024.11.12.21.30.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 21:30:31 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=byii2hdu; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DA440890DA; Wed, 13 Nov 2024 06:30:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="byii2hdu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9BF34890FD; Wed, 13 Nov 2024 06:30:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8ABC5890D0 for ; Wed, 13 Nov 2024 06:30:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5cedea84d77so8418326a12.1 for ; Tue, 12 Nov 2024 21:30:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731475828; x=1732080628; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DKrJbpWRaDd1GYUijQZs/ag6OlEvE2Rs3FfpeY/pjOY=; b=byii2hducz2T1LkyF7ERaUwWs24y4/DHrQkye79eeIU0tS3svbGEVnvZMT6i6ZHUxt 7kUXALQBIedljYD5NZReZrja9tJ0v8GrbwnQWaKf3T/wwWdWV+Umab0EojDDAIVEbkkg l0riztPzJa3dBibAOCV9GPCTMXj61Qxj25UkEG5XM51+zQkzR8TjYZQluEujnJsi09ht 6GqWSo4TWOMSNazX97Y+qxeEXetHau1lTMooxvh6/WFzwdbtJA3VT+BsoseApDnV3wT7 NqUxz15ll3NnKzvHJIs1tqWRZds0v0iiJvXxfSlgtQSU34MvA40TErD2jf4S2pUe43pR Jrgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731475828; x=1732080628; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DKrJbpWRaDd1GYUijQZs/ag6OlEvE2Rs3FfpeY/pjOY=; b=TzK+kTrGM3SwdDTzwjzHuV+IUaaMBRCQq0eUDWkvuDKklHfyiL6FhQ4rCsFTyNsVk3 gaRRy2ScGAjn2fnWbgkTP12+y/grO/Dn0u8YWEnARf9cb89ndkXGb+H9caC8Y0VZ2HIt vH8/81zo4CYUJb7nM5O6gybhiLuetOSqaSNCleWfHa2M1ApDVEUpl1DmT12CAx6TFA9I Qp3ObMLa2zb3ZOBH87J5Q0t6kxHfrK2MXou6sEM6KYS6b4N5zlSxVDbJEHyAGzhXz2oR ZnGItjfhSZTspYTgM5UnE8ZknqHPBQcoy/bHQGyql3W0b6Ijj4pAld/oi+kEbIS+WBUj JBaw== X-Gm-Message-State: AOJu0YyJxFtXoGAOYtNg2QybBNiM2reXvMOnyXAh7kenSkXygocfDfGh iq8QDzRo7aU8HOVqoHh+pDLo3biyOWJgFd5wCpasRL4V/hbIae4TXTim0h7eMlU= X-Received: by 2002:aa7:dcd7:0:b0:5cf:6450:319f with SMTP id 4fb4d7f45d1cf-5cf6450322emr757815a12.8.1731475827852; Tue, 12 Nov 2024 21:30:27 -0800 (PST) Received: from lion.caleb.rex.connolly.tech ([2a02:8109:888d:ff00:ca7f:54ff:fe52:4519]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cf537fc229sm1334487a12.44.2024.11.12.21.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 21:30:26 -0800 (PST) From: Caleb Connolly To: Caleb Connolly , Christian Marangi , Dragan Simic , Ilias Apalodimas , Jaehoon Chung , Jerome Forissier , Jonas Karlman , Marek Vasut , Peng Fan , Peter Robinson , Rasmus Villemoes , Simon Glass , Sughosh Ganu , Tom Rini Cc: u-boot@lists.denx.de Subject: [PATCH] mmc: don't print 'MMC:' if there are no MMC devices Date: Wed, 13 Nov 2024 06:30:08 +0100 Message-ID: <20241113053023.1870736-1-caleb.connolly@linaro.org> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Ilias Apalodimas --- 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; + } printf("%s: %d", m->cfg->name, m->block_dev.devnum); if (mmc_type) printf(" (%s)", mmc_type);