From: Guenter Roeck <linux@roeck-us.net>
To: Octavian Purdila <octavian.purdila@intel.com>
Cc: Wolfram Sang <wsa@the-dreams.de>, Johan Hovold <johan@kernel.org>,
linux-i2c <linux-i2c@vger.kernel.org>,
linux-api@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v2 3/3] i2c: show and change bus frequency via sysfs
Date: Wed, 15 Oct 2014 06:13:54 -0700 [thread overview]
Message-ID: <543E7312.1020104@roeck-us.net> (raw)
In-Reply-To: <CAE1zotKpgEqAhtQvsFFee8xnX02MmhwrM0YU-6OHVZHcxiAi9g@mail.gmail.com>
On 10/15/2014 04:49 AM, Octavian Purdila wrote:
> On Tue, Oct 14, 2014 at 6:41 PM, Guenter Roeck <linux@roeck-us.net> wrote:
>>
>> On Tue, Oct 14, 2014 at 05:48:14PM +0300, Octavian Purdila wrote:
>>> This patch adds three new sysfs files: bus_frequency,
>>> bus_min_frequency and bus_max_frequency which allows the user to view
>>> or change the bus frequency on a per bus level.
>>>
>
> <snip>
>
>>> +
>>> +static DEVICE_ATTR(bus_frequency, S_IRUGO, i2c_sysfs_freq_show,
>>> + i2c_sysfs_freq_store);
>>
>> Consider using DEVICE_ATTR_RO here. Also, extra empty line.
>>
>
> Unfortunately that won't work because we must transform bus_frequency
> to a RW entry (via is_visible) if the bus can change the frequency. We
Ah yes, you are right.
> can't use DEVIE_ATTR_RW either, because transforming a RW entry to a
> RO entry with is visible is not possible:
>
Why not ?
is_visible returns the desired mode. Just like you can return mode | S_IWUSR,
you can return mode & ~S_IWUSR.
Am I missing something ?
Guenter
next prev parent reply other threads:[~2014-10-15 13:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-14 14:48 [RFC PATCH v2 0/3] i2c: show and change bus frequency via sysfs Octavian Purdila
2014-10-14 14:48 ` [RFC PATCH v2 1/3] i2c: document the existing i2c sysfs ABI Octavian Purdila
2014-10-14 14:48 ` [RFC PATCH v2 2/3] i2c: document struct i2c_adapter Octavian Purdila
2014-10-14 14:48 ` [RFC PATCH v2 3/3] i2c: show and change bus frequency via sysfs Octavian Purdila
2014-10-14 15:41 ` Guenter Roeck
2014-10-15 11:49 ` Octavian Purdila
2014-10-15 13:13 ` Guenter Roeck [this message]
2014-10-15 13:32 ` Octavian Purdila
2014-10-15 13:46 ` Guenter Roeck
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=543E7312.1020104@roeck-us.net \
--to=linux@roeck-us.net \
--cc=johan@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=octavian.purdila@intel.com \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox