From: Aaron Sierra <asierra@xes-inc.com>
To: linux-mtd@lists.infradead.org
Cc: Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: [PATCH 1/2] mtd: physmap_of: Add read-only fallback
Date: Thu, 25 Sep 2014 12:20:08 -0500 (CDT) [thread overview]
Message-ID: <2002674283.65675.1411665608272.JavaMail.zimbra@xes-inc.com> (raw)
In-Reply-To: <103889901.65008.1411665422229.JavaMail.zimbra@xes-inc.com>
From: Joe Schultz <jschultz@xes-inc.com>
Previously, when probing a CFI chip which was write-protected at the
hardware level, the probe would fail due to the fact it could not put
the chip into QUERY mode. This would result in no MTD devices being
created.
Add a fallback to probe using the map_rom driver if the user-selected
probe fails.
Signed-off-by: Joe Schultz <jschultz@xes-inc.com>
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
---
drivers/mtd/maps/physmap_of.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/mtd/maps/physmap_of.c b/drivers/mtd/maps/physmap_of.c
index c62e1c3..efbf416 100644
--- a/drivers/mtd/maps/physmap_of.c
+++ b/drivers/mtd/maps/physmap_of.c
@@ -272,6 +272,16 @@ static int of_flash_probe(struct platform_device *dev)
info->list[i].mtd = obsolete_probe(dev,
&info->list[i].map);
}
+
+ /* Fall back to mapping region as ROM */
+ if (!info->list[i].mtd) {
+ dev_warn(&dev->dev,
+ "do_map_probe() failed for type %s\n",
+ probe_type);
+
+ info->list[i].mtd = do_map_probe("map_rom",
+ &info->list[i].map);
+ }
mtd_list[i] = info->list[i].mtd;
err = -ENXIO;
--
1.9.1
next parent reply other threads:[~2014-09-25 17:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <103889901.65008.1411665422229.JavaMail.zimbra@xes-inc.com>
2014-09-25 17:20 ` Aaron Sierra [this message]
2014-12-17 2:37 ` [PATCH 1/2] mtd: physmap_of: Add read-only fallback Brian Norris
2014-12-17 16:19 ` Aaron Sierra
2015-01-10 7:29 ` 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=2002674283.65675.1411665608272.JavaMail.zimbra@xes-inc.com \
--to=asierra@xes-inc.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.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