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]
Message-Id: <40fb5e2b35d613f1116d31876fbf79c94bec4fd1.1698717154.git.zhoubinbin@loongson.cn>
Date:   Tue, 31 Oct 2023 10:36:57 +0800
From:   Binbin Zhou <zhoubinbin@...ngson.cn>
To:     Binbin Zhou <zhoubb.aaron@...il.com>,
        Huacai Chen <chenhuacai@...ngson.cn>,
        Thomas Gleixner <tglx@...utronix.de>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>
Cc:     Huacai Chen <chenhuacai@...nel.org>,
        loongson-kernel@...ts.loongnix.cn, devicetree@...r.kernel.org,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Jiaxun Yang <jiaxun.yang@...goat.com>,
        linux-mips@...r.kernel.org, lvjianmin@...ngson.cn,
        WANG Xuerui <git@...0n.name>, loongarch@...ts.linux.dev,
        linux-kernel@...r.kernel.org, Binbin Zhou <zhoubinbin@...ngson.cn>
Subject: [PATCH v3 4/5] irqchip/loongson-liointc: Fix 'loongson,parent_int_map' parse

While 'loongson,parent_int_map' is deprecated, we need to make sure that
both forms can be parsed.

Signed-off-by: Binbin Zhou <zhoubinbin@...ngson.cn>
---
 drivers/irqchip/irq-loongson-liointc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c
index e4b33aed1c97..add2e0a955b8 100644
--- a/drivers/irqchip/irq-loongson-liointc.c
+++ b/drivers/irqchip/irq-loongson-liointc.c
@@ -330,6 +330,7 @@ static int __init liointc_of_init(struct device_node *node,
 	bool have_parent = FALSE;
 	int sz, i, index, revision, err = 0;
 	struct resource res;
+	const char *prop_name = "loongson,parent-int-map";
 
 	if (!of_device_is_compatible(node, "loongson,liointc-2.0")) {
 		index = 0;
@@ -350,8 +351,12 @@ static int __init liointc_of_init(struct device_node *node,
 	if (!have_parent)
 		return -ENODEV;
 
+	if (!of_find_property(node, prop_name, &i))
+		/* Fallback to 'loongson,parent_int_map', although it is deprecated. */
+		prop_name = "loongson,parent_int_map";
+
 	sz = of_property_read_variable_u32_array(node,
-						"loongson,parent_int_map",
+						prop_name,
 						&parent_int_map[0],
 						LIOINTC_NUM_PARENT,
 						LIOINTC_NUM_PARENT);
-- 
2.39.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ