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:   Fri, 14 Aug 2020 11:03:56 +0100
From:   Thomas Preston <thomas.preston@...ethink.co.uk>
To:     linus.walleij@...aro.org, robh+dt@...nel.org,
        linux-gpio@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     thomas.preston@...ethink.co.uk
Subject: [PATCH 2/3] pinctrl: mcp23s08: Remove interrupt-controller

The mcp23s08 device and friends are interrupt /client/ nodes, and should
not reference the interrupt controller device tree property
"interrupt-controller" [0].

Fix the mcp23s08 driver so that it activates interrupts when it detects
the "interrupts" property instead, which is always present if we want
interrupts enabled.

[0] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

Signed-off-by: Thomas Preston <thomas.preston@...ethink.co.uk>
---
 drivers/pinctrl/pinctrl-mcp23s08.c | 7 +++----
 drivers/pinctrl/pinctrl-mcp23s08.h | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
index 0138638276e7..ac8926985c28 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08.c
@@ -566,9 +566,8 @@ int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
 	if (ret < 0)
 		goto fail;
 
-	mcp->irq_controller =
-		device_property_read_bool(dev, "interrupt-controller");
-	if (mcp->irq && mcp->irq_controller) {
+	mcp->irq_enabled = device_property_present(dev, "interrupts");
+	if (mcp->irq && mcp->irq_enabled) {
 		mcp->irq_active_high =
 			device_property_read_bool(dev,
 					      "microchip,irq-active-high");
@@ -601,7 +600,7 @@ int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
 			goto fail;
 	}
 
-	if (mcp->irq && mcp->irq_controller) {
+	if (mcp->irq && mcp->irq_enabled) {
 		struct gpio_irq_chip *girq = &mcp->chip.irq;
 
 		girq->chip = &mcp->irq_chip;
diff --git a/drivers/pinctrl/pinctrl-mcp23s08.h b/drivers/pinctrl/pinctrl-mcp23s08.h
index 90dc27081a3c..1aa9b11780fc 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.h
+++ b/drivers/pinctrl/pinctrl-mcp23s08.h
@@ -30,7 +30,7 @@ struct mcp23s08 {
 	u16			irq_rise;
 	u16			irq_fall;
 	int			irq;
-	bool			irq_controller;
+	bool			irq_enabled;
 	int			cached_gpio;
 	/* lock protects regmap access with bypass/cache flags */
 	struct mutex		lock;
-- 
2.26.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ