linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] IIO: industrialio-core: Checking NULL instead of IS_ERR for debugfs_create_dir()
@ 2012-05-03 14:56 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2012-05-03 14:56 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jonathan Cameron, Michael Hennerich, linux-iio, Greg Kroah-Hartman

If defined CONFIG_DEBUG_FS, debugfs_create_dir returns NULL on failure.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 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 72e33b8..c74412b 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -235,15 +235,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");
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-03 14:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03 14:56 [PATCH] IIO: industrialio-core: Checking NULL instead of IS_ERR for debugfs_create_dir() Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).