From patchwork Fri Dec 29 17:00:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 122941 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4912469qgn; Fri, 29 Dec 2017 09:01:31 -0800 (PST) X-Google-Smtp-Source: ACJfBouLioWoXRVsOtfdjXwBiXD3Wy78bWK4O9nzJRXQ8qK8HIqnPnDa/Vk0MjUtvB60x1K6dpfz X-Received: by 10.80.145.3 with SMTP id e3mr45518969eda.273.1514566891507; Fri, 29 Dec 2017 09:01:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514566891; cv=none; d=google.com; s=arc-20160816; b=e/wHBpM3Jk9egVuYi9I4yo+LrjXU1j6/vYxsYThhB5Fl0PsQvBCQWmUGpXI7Ei5tDo DZ9uYT3bO/EOzQgcaMBzlk1PDWHUOBqr04hwPRDdK9V5PyBlhvi9WMwmjtdGzmZKykdZ f46pCeYRNqzhqWziuhQFxZ/W56+y8XzjaqLypsYBf0qeMsSYkv0YhoHJUyIrDt7uc0KR rlc/LSuulCJUNR+NlcqDhYEVqXBVI78pO7EzkMldO6+k957r6UzNyjil1JyvF7hNRsx0 J5R6z2hJs3zDQ/O0oHQApTyl55iaMxqvg9NWQySbyYoVqyR0S69KvtK6G7saDyr9Nw/M H4/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:dkim-filter:arc-authentication-results; bh=w9tdKzFQ5SejdNioZ3Z1UIqzDbo4D2X/GCcWHfVWrIU=; b=bojNafAt8uqkEL/mfjrLUhPHb2gGemOd1p2jaTKgX6athFe/GQVRo2jgSAg66qZNkg 3lpw+o1FLKxpK6iriETVZuP6MRiR8QUyypSpmH44/RuyLNUHUthPNfotZhKisUlhWP90 I5m85UhEM+npePtX+uUJu1safzOcf0O8lra4B33gcnBY/JObf2kO7a9r2+1oa1deiN7x erlAm6dlotUkpLrDiguMHPmLyiv3r4xPdqDuGi+SliQpA5eKiHsGvUhfdgorzy2MkAZ5 XaDLYfZFJyEc99dfypY0HfjxIMuL2bUWjER17Vn8kLMxwHSP1FF/xdzgC0q2YJUMxAr0 2rZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=i3b3xn5r; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id a27si1326509edd.542.2017.12.29.09.01.31; Fri, 29 Dec 2017 09:01:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=i3b3xn5r; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id ECCAEC21D5D; Fri, 29 Dec 2017 17:01:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9EA22C21DB5; Fri, 29 Dec 2017 17:00:41 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2E5CAC21C34; Fri, 29 Dec 2017 17:00:39 +0000 (UTC) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by lists.denx.de (Postfix) with ESMTPS id 1E5B9C21C34 for ; Fri, 29 Dec 2017 17:00:37 +0000 (UTC) Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id vBTH0O9K000541; Sat, 30 Dec 2017 02:00:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vBTH0O9K000541 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1514566826; bh=M+9IU5mWr1Du45nw+3Wt+z7yVkYMwbAqxMA3fZ1sWbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i3b3xn5rYU6nFMbU+vtRR18hq7ExQ1wMxLczVmU0bUmkRpO6iWrtSdCoqhRS5YLDD QwKvkx7/L/UqWyi+uEALZZy1p6MyD1+0vz/8LmOSItxFDJ+pvQUydxd9jEhIDLDNsl hlBEMuQrgf7Espp0oZudStddHsldK7EDa3VeZ9azM0Af5SNQ7TUL8oj5pYlspEF13k bhF7qmCftQc5/eXFJxDX3hgtidXWpAUuf3B5E6wotfukMNdbU/wBBIrPtcvEcW3Hwh bt9I0UdXV9ejHXVUxd/IGrfd+bmiANVnQS7ezAJ6/bdbJJ5KFrpgJ1XmTSSG81APom SC0VwIpGJYOIQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 30 Dec 2017 02:00:07 +0900 Message-Id: <1514566812-16781-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> References: <1514566812-16781-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 3/8] mmc: let mmc_of_parse() fail for insane bus-width value X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" You must fix your DT if it specifies insane bus-width, for example, bus-width = <3>; debug() is not displayed in usual configuration, so people will not even notice weirdness. Use dev_err() instead, then let it fail. Signed-off-by: Masahiro Yamada --- drivers/mmc/mmc-uclass.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index 37ce922..44c36dc 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -140,10 +140,8 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg) cfg->host_caps |= MMC_MODE_1BIT; break; default: - debug("warning: %s invalid bus-width property. using 1-bit\n", - dev_read_name(dev)); - cfg->host_caps |= MMC_MODE_1BIT; - break; + dev_err(dev, "Invalid \"bus-width\" value %u!\n", val); + return -EINVAL; } /* f_max is obtained from the optional "max-frequency" property */