[PATCH 41/61] pinctrl: Prefer IS_ERR_OR_NULL over manual NULL check

Philipp Hahn
2026-03-10T11:55:51Z

Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: Linus Walleij <linusw@kernel.org>
Cc: linux-gpio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
---
drivers/pinctrl/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index b5e97689589fbf1b6750620fc193bc820012be2b..97a80989601abbe969d4b64cb0f3926fd4f291f5 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1991,7 +1991,7 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev)
device_root = debugfs_create_dir(debugfs_name, debugfs_root);
pctldev->device_root = device_root;

- if (IS_ERR(device_root) || !device_root) {
+ if (IS_ERR_OR_NULL(device_root)) {
pr_warn("failed to create debugfs directory for %s\n",
dev_name(pctldev->dev));
return;

--
2.43.0