Skip to content

Commit 92f4368

Browse files
Li ZetaoLinus Walleij
authored andcommitted
pinctrl: Remove redundant null pointer checks in pinctrl_remove_device_debugfs()
Since the debugfs_create_dir() never returns a null pointer, checking the return value for a null pointer is redundant, and using IS_ERR is safe enough. Signed-off-by: Li Zetao <lizetao1@huawei.com> Link: https://lore.kernel.org/20240903143812.2005071-1-lizetao1@huawei.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent dbf0e9d commit 92f4368

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/pinctrl/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,7 @@ static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev)
19711971
static void pinctrl_init_debugfs(void)
19721972
{
19731973
debugfs_root = debugfs_create_dir("pinctrl", NULL);
1974-
if (IS_ERR(debugfs_root) || !debugfs_root) {
1974+
if (IS_ERR(debugfs_root)) {
19751975
pr_warn("failed to create debugfs directory\n");
19761976
debugfs_root = NULL;
19771977
return;

0 commit comments

Comments
 (0)