From patchwork Mon Jul 27 20:30:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Suchanek X-Patchwork-Id: 500646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A77E1140318 for ; Tue, 28 Jul 2015 06:32:52 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZJp3C-00082x-84; Mon, 27 Jul 2015 20:31:06 +0000 Received: from dec59.ruk.cuni.cz ([2001:718:1e03:4::11]) by bombadil.infradead.org with smtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZJp3A-0007z6-8g for linux-mtd@lists.infradead.org; Mon, 27 Jul 2015 20:31:04 +0000 Received: (qmail 46308 invoked by uid 2313); 27 Jul 2015 20:30:43 -0000 Date: 27 Jul 2015 20:30:43 -0000 MBOX-Line: From 2feb6039b908bbe7daf98c0fc3b7c8f725c36ac3 Mon Sep 17 00:00:00 2001 Message-Id: <2feb6039b908bbe7daf98c0fc3b7c8f725c36ac3.1438028045.git.hramrach@gmail.com> In-Reply-To: References: From: Michal Suchanek Subject: [PATCH 2/3] mtd: ofpart: do not fail probe when no partitions exist To: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150727_133104_667348_EC50FCC7 X-CRM114-Status: GOOD ( 10.04 ) X-Spam-Score: -4.3 (----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-4.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [2001:718:1e03:4:0:0:0:11 listed in] [list.dnswl.org] -1.3 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hramrach[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Exynos it is necessary to set SPI controller parameters that apply to a SPI slave in a DT subnode of the slave device. Example: flash: m25p80@0 { #address-cells = <1>; #size-cells = <1>; compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <40000000>; m25p,fast-read; controller-data { samsung,spi-feedback-delay = <0>; }; }; The ofpart code checks if there are any subnodes on the MTD device DT node and if so it tries to parse them as MTD partitions (example below) flash@0 { #address-cells = <1>; #size-cells = <1>; partition@0 { label = "u-boot"; reg = <0x0000000 0x100000>; read-only; }; uimage@100000 { reg = <0x0100000 0x200000>; }; }; The controller-data node contains no partition information and no other subnodes with partition information exist. The ofpart code returns an error when there are subnodes of the flash DT node but no partitions are found. This error is then propagated to mtdpart which propagetes it to MTD probe which fails probing the flash device. Change this condition to a warning so that flash without partitions can be accessed on Exynos with ofpart support compiled in. Signed-off-by: Michal Suchanek --- - add more verbose explanation --- drivers/mtd/ofpart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index aa26c32..a29d29f 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c @@ -94,10 +94,10 @@ static int parse_ofpart_partitions(struct mtd_info *master, if (!i) { of_node_put(pp); - pr_err("No valid partition found on %s\n", node->full_name); + pr_warn("No valid partition found on %s\n", node->full_name); kfree(*pparts); *pparts = NULL; - return -EINVAL; + return 0; } return nr_parts;