Commit abd5a2fb authored by Axel Lin's avatar Axel Lin Committed by Greg Kroah-Hartman

IIO: industrialio-core: Checking NULL instead of IS_ERR for debugfs_create_dir()

If defined CONFIG_DEBUG_FS, debugfs_create_dir returns NULL on failure.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5a28c873
...@@ -227,15 +227,12 @@ static int iio_device_register_debugfs(struct iio_dev *indio_dev) ...@@ -227,15 +227,12 @@ static int iio_device_register_debugfs(struct iio_dev *indio_dev)
if (indio_dev->info->debugfs_reg_access == NULL) if (indio_dev->info->debugfs_reg_access == NULL)
return 0; return 0;
if (IS_ERR(iio_debugfs_dentry)) if (!iio_debugfs_dentry)
return 0; return 0;
indio_dev->debugfs_dentry = indio_dev->debugfs_dentry =
debugfs_create_dir(dev_name(&indio_dev->dev), debugfs_create_dir(dev_name(&indio_dev->dev),
iio_debugfs_dentry); iio_debugfs_dentry);
if (IS_ERR(indio_dev->debugfs_dentry))
return PTR_ERR(indio_dev->debugfs_dentry);
if (indio_dev->debugfs_dentry == NULL) { if (indio_dev->debugfs_dentry == NULL) {
dev_warn(indio_dev->dev.parent, dev_warn(indio_dev->dev.parent,
"Failed to create debugfs directory\n"); "Failed to create debugfs directory\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment