All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Hennerich <michael.hennerich@analog.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"device-drivers-devel@blackfin.uclinux.org"
	<device-drivers-devel@blackfin.uclinux.org>,
	Drivers <Drivers@analog.com>
Subject: Re: [PATCH 1/3] iio: core: Introduce debugfs support, add support for direct register access
Date: Thu, 1 Mar 2012 10:44:45 +0100	[thread overview]
Message-ID: <4F4F450D.9040509@analog.com> (raw)
In-Reply-To: <4F4E8738.3080202@kernel.org>

On 02/29/2012 09:14 PM, Jonathan Cameron wrote:
> On 02/22/2012 12:30 PM, michael.hennerich@analog.com wrote:
>> From: Michael Hennerich<michael.hennerich@analog.com>
> Looks fine. One trivial formatting quirk inline and a question
> about the recursive call (though I can't see it doing any harm!)
>
>> Changes since V1:
>>
>> debugfs:
>>
>> Exclude iio debugfs code in case CONFIG_DEBUG_FS isn't enabled.
>>        Introduce helper function iio_get_debugfs_dentry.
>>        Document additions to struct iio_dev
>>
>> iio_debugfs_read_reg:
>>        Use snprintf.
>>        Use a shorter fixed length.
>>        Introduce len instead of pointer math.
>>
>> iio_debugfs_write_reg:
>>        Fix return value use PTR_ERR.
>>        sscanf scan hex, decimal and octal.
>>        Ensure zero terminated string.
>>
>> Signed-off-by: Michael Hennerich<michael.hennerich@analog.com>
> Acked-by: Jonathan Cameron<jic23@kernel.org>
>>   #endif /* _INDUSTRIAL_IO_H_ */
>> diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
>> index e4824fe..82c9128 100644
>> --- a/drivers/staging/iio/industrialio-core.c
>> +++ b/drivers/staging/iio/industrialio-core.c
>> @@ -22,6 +22,7 @@
>>   #include<linux/cdev.h>
>>   #include<linux/slab.h>
>>   #include<linux/anon_inodes.h>
>> +#include<linux/debugfs.h>
>>   #include "iio.h"
>>   #include "iio_core.h"
>>   #include "iio_core_trigger.h"
>> @@ -39,6 +40,8 @@ struct bus_type iio_bus_type = {
>>   };
>>   EXPORT_SYMBOL(iio_bus_type);
>>
>> +static struct dentry *iio_debugfs_dentry;
>> +
>>   static const char * const iio_data_type_name[] = {
>>        [IIO_RAW] = "raw",
>>        [IIO_PROCESSED] = "input",
>> @@ -129,6 +132,8 @@ static int __init iio_init(void)
>>                goto error_unregister_bus_type;
>>        }
>>
>> +     iio_debugfs_dentry = debugfs_create_dir("iio", NULL);
>> +
>>        return 0;
>>
>>   error_unregister_bus_type:
>> @@ -142,8 +147,129 @@ static void __exit iio_exit(void)
>>        if (iio_devt)
>>                unregister_chrdev_region(iio_devt, IIO_DEV_MAX);
>>        bus_unregister(&iio_bus_type);
>> +     debugfs_remove_recursive(iio_debugfs_dentry);
> Not sure it matters, but shouldn't we have cleared everything other than
> the directory before this gets called?  If so why the recursive version?

Hi Jonathan,

Thanks for the review.

The recursive version doesn't harm. But right you are -
debugfs_remove() is the cleaner option.
I'll fix this up before sending on to Greg.

-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif



  reply	other threads:[~2012-03-01  9:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-22 12:30 [PATCH 1/3] iio: core: Introduce debugfs support, add support for direct register access michael.hennerich
2012-02-22 12:30 ` [PATCH 2/3] iio: core: Avoid NULL pointer de-ref in case indio_dev->setup_ops are not in use michael.hennerich
2012-02-29 20:15   ` Jonathan Cameron
2012-02-22 12:30 ` [PATCH 3/3] iio: Convert platform_drivers to use module_platform_driver michael.hennerich
2012-02-29 20:16   ` Jonathan Cameron
2012-02-29 20:14 ` [PATCH 1/3] iio: core: Introduce debugfs support, add support for direct register access Jonathan Cameron
2012-03-01  9:44   ` Michael Hennerich [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-03-01  9:51 michael.hennerich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F4F450D.9040509@analog.com \
    --to=michael.hennerich@analog.com \
    --cc=Drivers@analog.com \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.