From: Dan Carpenter Date: Thu, 22 Oct 2020 07:06:59 +0000 (+0300) Subject: hwmon: (pmbus/max20730) delete some dead code X-Git-Tag: accepted/tizen/unified/20230118.172025~8307^2~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92bc2e1f82afa2e456d7416598ffdf3dbf267835;p=platform%2Fkernel%2Flinux-rpi.git hwmon: (pmbus/max20730) delete some dead code The debugfs_create_dir() function never returns NULL. Normal users are not supposed to check the return value so the correct fix is just to delete this check. In the case where the debugfs_create_dir() fails, the function returns NULL. The other debugfs function check for NULL directory and handle it. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20201022070659.GA2817762@mwanda Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/pmbus/max20730.c b/drivers/hwmon/pmbus/max20730.c index be83b98..00fea16 100644 --- a/drivers/hwmon/pmbus/max20730.c +++ b/drivers/hwmon/pmbus/max20730.c @@ -328,8 +328,6 @@ static int max20730_init_debugfs(struct i2c_client *client, return -ENOENT; max20730_dir = debugfs_create_dir(client->name, debugfs); - if (!max20730_dir) - return -ENOENT; for (i = 0; i < MAX20730_DEBUGFS_NUM_ENTRIES; ++i) psu->debugfs_entries[i] = i;