From patchwork Thu Oct 29 12:52:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 55765 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp544449lbr; Thu, 29 Oct 2015 05:54:06 -0700 (PDT) X-Received: by 10.107.4.3 with SMTP id 3mr3660130ioe.195.1446123246624; Thu, 29 Oct 2015 05:54:06 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id nt8si2958589igb.13.2015.10.29.05.54.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2015 05:54:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com 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 1Zrmi8-0000rc-I8; Thu, 29 Oct 2015 12:53:44 +0000 Received: from mail-lb0-x233.google.com ([2a00:1450:4010:c04::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zrmhi-0000fT-H8 for linux-mtd@lists.infradead.org; Thu, 29 Oct 2015 12:53:20 +0000 Received: by lbbwb3 with SMTP id wb3so27670488lbb.1 for ; Thu, 29 Oct 2015 05:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Izvp4oZl0aye+5m/nmjECdO7sBGGlmBQjDMEJp4dGqA=; b=DfpixM2xXRof6z8ef+O2uld/l4j0VEGO1GwcHvKHtX9968iqvC6JaWuDWyOEwVZ9Dg ik0niglWQWKe4/TG0SWvq7v6OhRN6RNbmYXukY8vw/bMXoew6NO90HITrkfeRCitHoV/ gTTzBcuT6GcW2dnji8QMitlCO+2vYANsfMj2U5K9jV73W4yWXWqRFN/0xJpunGbAPjUc QemrRzDT1ZcDNQzlaJuPh92JiSJNkiJ8yYCMb8QFYDOcu1/sTx83nPlJbOREaXOaDDYU DmYHGph4T/i4K2/puQiM1txNSPbJJvH6jHXimpJtk4oM0AqdiM8ubUgOAf0IaSXP9fhS NVyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Izvp4oZl0aye+5m/nmjECdO7sBGGlmBQjDMEJp4dGqA=; b=Irx4h7vZU8YQQxVuwwv0rb9/XvT9yeNMLl0szBCb7s6+412WBPFHKFrkVDz+TpY0Hr QfB9NBFB6KS1sPOSGeSLdo5M8bJ1R/m8KaT0oF4R+ejD+pUlvkPSlsngvePkU39ihCKO c90dYtV7ATUePRTWIuavHBFctSvanTusuuwi8ftJKJr7DPK9aiJfYFyMYU8/6nnBDRvc ayUfp/veXPhNTXVN6ROtRA/E5BuahynSvTkyWLdB2hVOwgXuQ27EMzYEejgFGWI+xwNo DmDdXYEkdlowIvYUm6m604NprjW37GD5vhsqC9uDqOomRUBbHzkTMp4aHK6cYy+b6iad DyRQ== X-Gm-Message-State: ALoCoQnAs5KLwwznylsLhR9d23uUvRVcggGyZJklTx7++SJkPiTFfl1mFvh/jATn6ZARYlRtsPQV X-Received: by 10.112.149.97 with SMTP id tz1mr879686lbb.57.1446123176556; Thu, 29 Oct 2015 05:52:56 -0700 (PDT) Received: from localhost.localdomain ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o197sm300467lfb.7.2015.10.29.05.52.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2015 05:52:55 -0700 (PDT) From: Linus Walleij To: David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org Subject: [PATCH 3/3] mtd: physmap_of: handle the new "partition-type" Date: Thu, 29 Oct 2015 13:52:32 +0100 Message-Id: <1446123152-22666-3-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1446123152-22666-1-git-send-email-linus.walleij@linaro.org> References: <1446123152-22666-1-git-send-email-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151029_055319_002135_E83AFDEF X-CRM114-Status: GOOD ( 17.66 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c04:0:0:0:233 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: , Cc: Linus Walleij , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org We defined a new device tree binding for partitions, and if they are found these need to be translated into a string array of Linux partitions. Reuse the string-to-array split function and support "arm,arm-flash-structure" by splitting "afs" into {"afs", NULL} and passing that along. Signed-off-by: Linus Walleij --- drivers/mtd/maps/physmap_of.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- 2.4.3 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c index 1b66ca66206b..8c09d7e23b6e 100644 --- a/drivers/mtd/maps/physmap_of.c +++ b/drivers/mtd/maps/physmap_of.c @@ -105,7 +105,7 @@ static struct mtd_info *obsolete_probe(struct platform_device *dev, } } -/* When partitions are set we look for a linux,part-probe property which +/* When partitions are set we look for a partition-type property which specifies the list of partition probers to use. If none is given then the default is use. These take precedence over other device tree information. */ @@ -150,9 +150,25 @@ static const char * const *of_get_probes(struct device_node *dp) int cplen; int ret; + /* + * The proper device tree bindings take precedence. + */ + ret = of_property_read_string(dp, "partition-type", &cp); + if (!ret) { + pr_info("check for partition type \"%s\"\n", cp); + if (!strcmp(cp, "arm,arm-flash-structure")) + return string_to_array("afs", 1); + } + + /* + * Else look for the deprecated binding, or fall back to + * defaults. + */ cp = of_get_property(dp, "linux,part-probe", &cplen); if (cp == NULL) return part_probe_types_def; + pr_info("DT is using the deprecated \"linux,part-probe\" binding\n"); + pr_info("please move to the standard \"partition-type\" binding\n"); return string_to_array(cp, cplen); }