From 08e1e6cb7d417fbc733d4ca477a3c35513679f69 Mon Sep 17 00:00:00 2001 From: Jinjie Ruan Date: Sun, 3 Sep 2023 11:02:16 +0800 Subject: [PATCH] wifi: mt76: Drop unnecessary error check for debugfs_create_dir() debugfs_create_dir() returns ERR_PTR and never return NULL. As Russell suggested, this patch removes the error checking for debugfs_create_dir(). This is because the DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating() which can handle it gracefully. So these checks are unnecessary. Fixes: 17f1de56df05 ("mt76: add common code shared between multiple chipsets") Signed-off-by: Jinjie Ruan Suggested-by: Russell King (Oracle) Signed-off-by: Felix Fietkau --- debugfs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/debugfs.c b/debugfs.c index 79064a4d..c4649ba0 100644 --- a/debugfs.c +++ b/debugfs.c @@ -109,9 +109,6 @@ mt76_register_debugfs_fops(struct mt76_phy *phy, struct dentry *dir; dir = debugfs_create_dir("mt76", phy->hw->wiphy->debugfsdir); - if (!dir) - return NULL; - debugfs_create_u8("led_pin", 0600, dir, &phy->leds.pin); debugfs_create_bool("led_active_low", 0600, dir, &phy->leds.al); debugfs_create_u32("regidx", 0600, dir, &dev->debugfs_reg);