]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: Prefer IS_ERR_OR_NULL over manual NULL check
authorPhilipp Hahn <phahn-oss@avm.de>
Tue, 10 Mar 2026 11:49:07 +0000 (12:49 +0100)
committerLinus Walleij <linusw@kernel.org>
Wed, 11 Mar 2026 09:31:42 +0000 (10:31 +0100)
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>
Signed-off-by: Linus Walleij <linusw@kernel.org>
drivers/pinctrl/core.c

index 2edc9bdad1832735cd9ca41e25eb2f8b4b5b4a1a..254161d52da75ce9de5406fdf8b1dbd66969d545 100644 (file)
@@ -1992,7 +1992,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;