Re: [PATCH v2 1/3] pmbus: introduce PMBUS_VIRT_*_SAMPLES registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/14/19 12:08 PM, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote:
On Sun, Apr 14, 2019 at 07:27:47AM -0700, Guenter Roeck wrote:
On 4/13/19 9:03 AM, Adamski, Krzysztof (Nokia - PL/Wroclaw) wrote:
Those virtual registers can be used to export manufacturer specific
functionality for controlling the number of samples for average values
reported by the device.

Signed-off-by: Krzysztof Adamski <krzysztof.adamski@xxxxxxxxx>
---
  Documentation/hwmon/sysfs-interface |  18 +++++
  drivers/hwmon/pmbus/pmbus.h         |  15 ++++
  drivers/hwmon/pmbus/pmbus_core.c    | 114 ++++++++++++++++++++++++++++
  3 files changed, 147 insertions(+)


[ ... ]

+
+static int pmbus_add_samples_attr(struct pmbus_data *data, int page,
+				  struct pmbus_samples_attr *attr)
+{
+	struct pmbus_samples_reg *reg;
+
+	reg = devm_kzalloc(data->dev, sizeof(*reg), GFP_KERNEL);
+	if (!reg)
+		return -ENOMEM;
+
+	reg->attr = attr;
+	reg->page = page;
+
+	pmbus_dev_attr_init(&reg->dev_attr, attr->name, (S_IWUSR | S_IRUGO),

S_IWUSR ran out of favor and generates a checkpatch warning.
Please use 0644.

I wasn't sure if its more important to care about checkpatch warning or
to keep convention in the file. I'll change to numerical value as
advised.

My plan was to convert all remaining S_xxx in hwmon drivers to numericals
in one go, probably right after the next release. I did have the patch for
this file ready, actually. I just sent it out for review, and added you
to Cc:.

Guenter



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux