mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] eeprom: at24: add the "read-only" dt parameter support
@ 2017-04-24 16:35 Antony Pavlov
  2017-04-25  5:44 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2017-04-24 16:35 UTC (permalink / raw)
  To: barebox

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] eeprom: at24: add the "read-only" dt parameter support
  2017-04-24 16:35 [PATCH] eeprom: at24: add the "read-only" dt parameter support Antony Pavlov
@ 2017-04-25  5:44 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2017-04-25  5:44 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Mon, Apr 24, 2017 at 07:35:59PM +0300, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
> ---
>  drivers/eeprom/at24.c | 4 ++++
>  1 file changed, 4 insertions(+)

Applied, thanks

Sascha

> 
> 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
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-25  5:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-24 16:35 [PATCH] eeprom: at24: add the "read-only" dt parameter support Antony Pavlov
2017-04-25  5:44 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox