All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: H Hartley Sweeten <hartleys@visionengravers.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"fmhess@users.sourceforge.net" <fmhess@users.sourceforge.net>,
	Ian Abbott <ian.abbott@mev.co.uk>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] staging: comedi: register sysfs device attributes with driver core
Date: Fri, 11 May 2012 14:14:02 +0100	[thread overview]
Message-ID: <4FAD109A.9040607@mev.co.uk> (raw)
In-Reply-To: <20120511061649.GW22134@mwanda>

On 2012-05-11 07:16, Dan Carpenter wrote:
> On Thu, May 10, 2012 at 06:05:28PM -0700, H Hartley Sweeten wrote:
>> -static const struct attribute_group comedi_sysfs_files = {
>> -	.attrs	= comedi_attrs,
>> +static struct device_attribute comedi_dev_attrs[] = {
>> +	__ATTR(max_read_buffer_kb, S_IRUGO | S_IWUSR,
>> +		show_max_read_buffer_kb, store_max_read_buffer_kb),
>> +	__ATTR(read_buffer_kb, S_IRUGO | S_IWUSR | S_IWGRP,
>> +		show_read_buffer_kb, store_read_buffer_kb),
>> +	__ATTR(max_write_buffer_kb, S_IRUGO | S_IWUSR,
>> +		show_max_write_buffer_kb, store_max_write_buffer_kb),
>> +	__ATTR(write_buffer_kb, S_IRUGO | S_IWUSR | S_IWGRP,
>> +		show_write_buffer_kb, store_write_buffer_kb),
>> +	__ATTR_NULL
>
> Some of these are group writable and some are only user writable so
> it's not consistent.  Probably just make them user writeable.
>
> I guess this was in the original code too, but it's just more
> obvious now that they're grouped together.

Is it possible to change (group) ownership of these attribute files 
using udev rules?  Ideally, users in the group that has group ownership 
on the /dev/comedi* files should be able to modify the read_buffer_kb 
and write_buffer_kb attribute files as well, but only super-users should 
be able to modify the max_read_buffer_kb and max_write_buffer_kb files.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-

  reply	other threads:[~2012-05-11 13:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-11  1:05 [PATCH] staging: comedi: register sysfs device attributes with driver core H Hartley Sweeten
2012-05-11  6:16 ` Dan Carpenter
2012-05-11 13:14   ` Ian Abbott [this message]
2012-05-11 18:18     ` Dan Carpenter
2012-05-14 20:00 ` Greg KH

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=4FAD109A.9040607@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=fmhess@users.sourceforge.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=hartleys@visionengravers.com \
    --cc=ian.abbott@mev.co.uk \
    --cc=linux-kernel@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.