Skip to contentSkip to conversation

hwmon: (pmbus/dps920ab) Delete some dead code

PATCH Applied Dan Carpenter 2 participants 2 messages Jun 18, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (pmbus/dps920ab) Delete some dead code

The debugfs_create_dir() function returns error pointers, it doesn't return NULL. But debugfs functions don't need to be checked in normal situations and we can just delete this code.

Fixes 1f442e213ce5 ("hwmon: (pmbus) Add driver for Delta DPS-920AB PSU")
---
 drivers/hwmon/pmbus/dps920ab.c | 2 --
 1 file changed, 2 deletions(-)
drivers/hwmon/pmbus/dps920ab.c +0 -2
index bd2df2a3c8e3..d3941f6eb29a 100644
@@ -119,8 +119,6 @@ static void dps920ab_init_debugfs(struct dps920ab_data *data, struct i2c_client
 		return;
 
 	debugfs_dir = debugfs_create_dir(client->name, root);
-	if (!debugfs_dir)
-		return;
 
 	debugfs_create_file("mfr_id",
 			    0400,
Signature · 1 line
2.30.2
maintainer Applied
#1 lore raw
Quoted 6 lines · Dan Carpenter

The debugfs_create_dir() function returns error pointers, it doesn't return NULL. But debugfs functions don't need to be checked in normal situations and we can just delete this code.

Fixes 1f442e213ce5 ("hwmon: (pmbus) Add driver for Delta DPS-920AB PSU")

Applied.

Thanks,
Guenter

Quoted 20 lines
---
 drivers/hwmon/pmbus/dps920ab.c | 2 --
 1 file changed, 2 deletions(-)
drivers/hwmon/pmbus/dps920ab.c +0 -2
index bd2df2a3c8e3..d3941f6eb29a 100644
@@ -119,8 +119,6 @@ static void dps920ab_init_debugfs(struct dps920ab_data *data, struct i2c_client
 		return;
 
 	debugfs_dir = debugfs_create_dir(client->name, root);
-	if (!debugfs_dir)
-		return;
 
 	debugfs_create_file("mfr_id",
 			    0400,
Signature · 1 line
2.30.2