diff mbox series

[v2] mfd: stmpe: Support disabling sub-functions

Message ID 20201226162818.73782-1-oleksandr.suvorov@toradex.com (mailing list archive)
State New, archived
Headers show
Series [v2] mfd: stmpe: Support disabling sub-functions | expand

Commit Message

Oleksandr Suvorov Dec. 26, 2020, 4:28 p.m. UTC
Add support of sub-functions disabling. It allows one to define
an stmpe sub-function device in devicetree, but keep it disabled.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
---

Changes in v2:
Use for_each_available_child_of_node() instead of checking
of_device_is_available() for each node.
Thanks for Ahmad Fatoum a.fatoum@pengutronix.de for and idea

 drivers/mfd/stmpe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 90f3292230c9..3e4f32673db3 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1357,7 +1357,7 @@  static void stmpe_of_probe(struct stmpe_platform_data *pdata,
 
 	pdata->autosleep = (pdata->autosleep_timeout) ? true : false;
 
-	for_each_child_of_node(np, child) {
+	for_each_available_child_of_node(np, child) {
 		if (of_node_name_eq(child, "stmpe_gpio")) {
 			pdata->blocks |= STMPE_BLOCK_GPIO;
 		} else if (of_node_name_eq(child, "stmpe_keypad")) {