On Tue, Oct 14, 2014 at 6:41 PM, Guenter Roeck <linux@xxxxxxxxxxxx> 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
can't use DEVIE_ATTR_RW either, because transforming a RW entry to a
RO entry with is visible is not possible: