public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	Rob Herring <robh+dt@kernel.org>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"Frank Rowand" <frowand.list@gmail.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Jonas Gorski" <jonas.gorski@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"John Crispin" <john@phrozen.org>,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: [PATCH V8 2/2] mtd: ofpart: add of_match_table with "fixed-partitions"
Date: Wed, 17 Jan 2018 09:15:21 +0100	[thread overview]
Message-ID: <20180117081521.2463-2-zajec5@gmail.com> (raw)
In-Reply-To: <20180117081521.2463-1-zajec5@gmail.com>

From: Rafał Miłecki <rafal@milecki.pl>

This allows using this parser with any flash driver that takes care of
setting of_node (using mtd_set_of_node helper) correctly. Up to now
support for "fixed-partitions" DT compatibility string was working only
with flash drivers that were specifying "ofpart" (manually or by letting
mtd use the default set of parsers).

This matches existing bindings documentation.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Brian Norris <computersforpeace@gmail.com>
Tested-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/ofpart.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 6bdf4e525677..92fcbac046d9 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -140,9 +140,16 @@ static int parse_ofpart_partitions(struct mtd_info *master,
 	return ret;
 }
 
+static const struct of_device_id parse_ofpart_match_table[] = {
+	{ .compatible = "fixed-partitions" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, parse_ofpart_match_table);
+
 static struct mtd_part_parser ofpart_parser = {
 	.parse_fn = parse_ofpart_partitions,
 	.name = "ofpart",
+	.of_match_table = parse_ofpart_match_table,
 };
 
 static int parse_ofoldpart_partitions(struct mtd_info *master,
-- 
2.11.0

      reply	other threads:[~2018-01-17  8:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-02 13:04 [PATCH V5 1/2] mtd: partitions: add of_match_table parser matching Rafał Miłecki
2018-01-02 13:04 ` [PATCH V5 2/2] mtd: ofpart: add of_match_table with "fixed-partitions" Rafał Miłecki
2018-01-03 10:55 ` [PATCH V6 1/2] mtd: partitions: add of_match_table parser matching Rafał Miłecki
2018-01-03 10:55   ` [PATCH V6 2/2] mtd: ofpart: add of_match_table with "fixed-partitions" Rafał Miłecki
2018-01-03 18:28   ` [PATCH V6 1/2] mtd: partitions: add of_match_table parser matching Rob Herring
2018-01-04  6:32     ` Rafał Miłecki
2018-01-09  9:42       ` Boris Brezillon
2018-01-09 13:47         ` Rafał Miłecki
2018-01-04  7:05   ` [PATCH V7 " Rafał Miłecki
2018-01-04  7:05     ` [PATCH V7 2/2] mtd: ofpart: add of_match_table with "fixed-partitions" Rafał Miłecki
2018-01-11  9:04     ` [PATCH V7 1/2] mtd: partitions: add of_match_table parser matching Boris Brezillon
2018-01-17  8:15     ` [PATCH V8 " Rafał Miłecki
2018-01-17  8:15       ` Rafał Miłecki [this message]

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=20180117081521.2463-2-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=john@phrozen.org \
    --cc=jonas.gorski@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    /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