From: Axel Lin Date: Thu, 3 May 2012 14:56:58 +0000 (+0800) Subject: IIO: industrialio-core: Checking NULL instead of IS_ERR for debugfs_create_dir() X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=abd5a2fb3957b5a6eb8083044a61e1b95b770abf;p=~shefty%2Frdma-dev.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index 52aa44a8e20..b39a5875790 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) if (indio_dev->info->debugfs_reg_access == NULL) return 0; - if (IS_ERR(iio_debugfs_dentry)) + if (!iio_debugfs_dentry) return 0; indio_dev->debugfs_dentry = debugfs_create_dir(dev_name(&indio_dev->dev), iio_debugfs_dentry); - if (IS_ERR(indio_dev->debugfs_dentry)) - return PTR_ERR(indio_dev->debugfs_dentry); - if (indio_dev->debugfs_dentry == NULL) { dev_warn(indio_dev->dev.parent, "Failed to create debugfs directory\n");