From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH] eeprom: at24: add the "read-only" dt parameter support
Date: Mon, 24 Apr 2017 19:35:59 +0300 [thread overview]
Message-ID: <20170424163559.22379-1-antonynpavlov@gmail.com> (raw)
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
drivers/eeprom/at24.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/eeprom/at24.c b/drivers/eeprom/at24.c
index 1227286fbe..050a35aed8 100644
--- a/drivers/eeprom/at24.c
+++ b/drivers/eeprom/at24.c
@@ -454,6 +454,10 @@ static int at24_probe(struct device_d *dev)
at24->cdev.size = chip.byte_len;
writable = !(chip.flags & AT24_FLAG_READONLY);
+
+ if (of_get_property(dev->device_node, "read-only", NULL))
+ writable = 0;
+
if (writable) {
unsigned write_max = chip.page_size;
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2017-04-24 16:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 16:35 Antony Pavlov [this message]
2017-04-25 5:44 ` Sascha Hauer
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=20170424163559.22379-1-antonynpavlov@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=barebox@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