lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Sep 2021 19:01:05 +0800
From:   Joakim Zhang <qiangqing.zhang@....com>
To:     srinivas.kandagatla@...aro.org, robh+dt@...nel.org,
        shawnguo@...nel.org, a.fatoum@...gutronix.de
Cc:     kernel@...gutronix.de, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-imx@....com
Subject: [PATCH V2 2/6] nvmem: core: parse nvmem cell-type from device tree

From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>

get nvmem cell-type from device tree

Reviewed-by: Ahmad Fatoum <a.fatoum@...gutronix.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Signed-off-by: Joakim Zhang <qiangqing.zhang@....com>
---
 drivers/nvmem/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 3d87fadaa160..23c08dbaf45e 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -52,6 +52,7 @@ struct nvmem_cell {
 	int			bytes;
 	int			bit_offset;
 	int			nbits;
+	u32			type;
 	struct device_node	*np;
 	struct nvmem_device	*nvmem;
 	struct list_head	node;
@@ -726,6 +727,8 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
 			return -EINVAL;
 		}
 
+		of_property_read_u32(child, "cell-type", &cell->type);
+
 		cell->np = of_node_get(child);
 		nvmem_cell_add(cell);
 	}
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ