diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-05-03 10:56:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-08 19:04:11 -0400 |
commit | abd5a2fb3957b5a6eb8083044a61e1b95b770abf (patch) | |
tree | 33c16b6cada866cb61b595dab1d113035d255719 /drivers/iio | |
parent | 5a28c87397655cb0d791d04e45bd7cd5691ba0f2 (diff) |
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: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/industrialio-core.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 52aa44a8e209..b39a58757907 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c | |||
@@ -227,15 +227,12 @@ static int iio_device_register_debugfs(struct iio_dev *indio_dev) | |||
227 | if (indio_dev->info->debugfs_reg_access == NULL) | 227 | if (indio_dev->info->debugfs_reg_access == NULL) |
228 | return 0; | 228 | return 0; |
229 | 229 | ||
230 | if (IS_ERR(iio_debugfs_dentry)) | 230 | if (!iio_debugfs_dentry) |
231 | return 0; | 231 | return 0; |
232 | 232 | ||
233 | indio_dev->debugfs_dentry = | 233 | indio_dev->debugfs_dentry = |
234 | debugfs_create_dir(dev_name(&indio_dev->dev), | 234 | debugfs_create_dir(dev_name(&indio_dev->dev), |
235 | iio_debugfs_dentry); | 235 | iio_debugfs_dentry); |
236 | if (IS_ERR(indio_dev->debugfs_dentry)) | ||
237 | return PTR_ERR(indio_dev->debugfs_dentry); | ||
238 | |||
239 | if (indio_dev->debugfs_dentry == NULL) { | 236 | if (indio_dev->debugfs_dentry == NULL) { |
240 | dev_warn(indio_dev->dev.parent, | 237 | dev_warn(indio_dev->dev.parent, |
241 | "Failed to create debugfs directory\n"); | 238 | "Failed to create debugfs directory\n"); |