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 <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20201022070659.GA2817762@mwanda
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
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;