All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Cyrille Pitchen <cyrille.pitchen@atmel.com>
Cc: linux-mtd@lists.infradead.org, "Rafał Miłecki" <rafal@milecki.pl>
Subject: [PATCH 4/4] mtd: ofpart: add of_match_table with "fixed-partitions"
Date: Thu, 20 Apr 2017 15:54:31 +0200	[thread overview]
Message-ID: <20170420135431.12585-5-zajec5@gmail.com> (raw)
In-Reply-To: <20170420135431.12585-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>
---
 drivers/mtd/ofpart.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 2861c7079d7b..fb6f3df40e94 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

  parent reply	other threads:[~2017-04-20 13:55 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 13:54 [PATCH 0/4] mtd: extend support for "fixed-partitions" Rafał Miłecki
2017-04-20 13:54 ` [PATCH 1/4] dt-bindings: mtd: make partitions doc a bit more generic Rafał Miłecki
2017-04-20 13:54 ` [PATCH 2/4] mtd: partitions: factor out code calling parser Rafał Miłecki
2017-04-20 13:54 ` [PATCH 3/4] mtd: partitions: add of_match_table parser matching Rafał Miłecki
2017-04-20 13:54 ` Rafał Miłecki [this message]
2017-04-20 13:57 ` [PATCH RESEND 0/4] mtd: extend support for "fixed-partitions" Rafał Miłecki
2017-04-20 13:57   ` Rafał Miłecki
2017-04-20 13:57   ` [PATCH RESEND 1/4] dt-bindings: mtd: make partitions doc a bit more generic Rafał Miłecki
2017-04-20 13:57     ` Rafał Miłecki
2017-04-20 23:37     ` Brian Norris
2017-04-20 23:37       ` Brian Norris
2017-04-24 12:41     ` [PATCH V2 0/4] mtd: extend support for "fixed-partitions" Rafał Miłecki
2017-04-24 12:41       ` Rafał Miłecki
2017-04-24 12:41       ` [PATCH V2 1/4] dt-bindings: mtd: make partitions doc a bit more generic Rafał Miłecki
2017-04-24 12:41         ` Rafał Miłecki
2017-04-24 15:28         ` Jonas Gorski
2017-04-24 15:28           ` Jonas Gorski
2017-04-24 12:41       ` [PATCH V2 2/4] mtd: partitions: factor out code calling parser Rafał Miłecki
2017-04-24 12:41         ` Rafał Miłecki
2017-04-24 12:41       ` [PATCH V2 3/4] mtd: partitions: add of_match_table parser matching Rafał Miłecki
2017-04-24 12:41         ` Rafał Miłecki
2017-04-24 15:31         ` Jonas Gorski
2017-04-24 15:31           ` Jonas Gorski
2017-04-24 20:53           ` Rafał Miłecki
2017-04-24 20:53             ` Rafał Miłecki
2017-04-24 12:41       ` [PATCH V2 4/4] mtd: ofpart: add of_match_table with "fixed-partitions" Rafał Miłecki
2017-04-24 12:41         ` Rafał Miłecki
2017-04-20 13:57   ` [PATCH RESEND 2/4] mtd: partitions: factor out code calling parser Rafał Miłecki
2017-04-20 13:57     ` Rafał Miłecki
2017-04-20 23:45     ` Brian Norris
2017-04-20 23:45       ` Brian Norris
2017-04-20 13:57   ` [PATCH RESEND 3/4] mtd: partitions: add of_match_table parser matching Rafał Miłecki
2017-04-20 13:57     ` Rafał Miłecki
2017-04-20 23:59     ` Brian Norris
2017-04-20 23:59       ` Brian Norris
2017-04-20 13:57   ` [PATCH RESEND 4/4] mtd: ofpart: add of_match_table with "fixed-partitions" Rafał Miłecki
2017-04-20 13:57     ` Rafał Miłecki
2017-04-21  0:11     ` Brian Norris
2017-04-21  0:11       ` Brian Norris

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=20170420135431.12585-5-zajec5@gmail.com \
    --to=zajec5@gmail.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@atmel.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.