RE: [PATCH v6 2/3] eeprom: at24: add support to fetch eeprom device property "size"
From: Mani, Rajmohan <hidden>
Date: 2017-09-20 03:52:39
Also in:
linux-i2c, lkml
Adding Tomasz...
quoted hunk ↗ jump to hunk
-----Original Message----- From: Mohandass, Divagar Sent: Monday, September 04, 2017 3:29 AM To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org; mark.rutland-5wv7dgnIgG8@public.gmane.org; wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org; sakari.ailus-X3B1VOXEql0@public.gmane.org Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux- kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Mani, Rajmohan [off-list ref]; Mohandass, Divagar [off-list ref] Subject: [PATCH v6 2/3] eeprom: at24: add support to fetch eeprom device property "size" Obtain the size of the EEPROM chip from DT if the "size" property is specified for the device. Signed-off-by: Divagar Mohandass <redacted> --- drivers/misc/eeprom/at24.c | 4 ++++ 1 file changed, 4 insertions(+)diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index764ff5df..2199c42 100644--- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c@@ -570,6 +570,10 @@ static void at24_get_pdata(struct device *dev, structat24_platform_data *chip) if (device_property_present(dev, "read-only")) chip->flags |= AT24_FLAG_READONLY; + err = device_property_read_u32(dev, "size", &val); + if (!err) + chip->byte_len = val; + err = device_property_read_u32(dev, "pagesize", &val); if (!err) { chip->page_size = val; -- 1.9.1
-- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html