Commit 565e3afa authored by Rikard Falkeborn's avatar Rikard Falkeborn Committed by Vinod Koul

soundwire: sysfs: Constify static struct attribute_group

The only place sdw_slave_dev_attr_group is used is when its address is
passed to devm_device_add_group() which takes a pointer to const struct
attribute_group. Make it const to allow the compiler to put it in
read-only memory. This makes all attribute_group structs in the file
const. Done with the help of Coccinelle.
Signed-off-by: default avatarRikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210117221622.34315-1-rikard.falkeborn@gmail.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 0cff9911
...@@ -130,7 +130,7 @@ static struct attribute *slave_dev_attrs[] = { ...@@ -130,7 +130,7 @@ static struct attribute *slave_dev_attrs[] = {
* we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory * we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory
* for device-level properties * for device-level properties
*/ */
static struct attribute_group sdw_slave_dev_attr_group = { static const struct attribute_group sdw_slave_dev_attr_group = {
.attrs = slave_dev_attrs, .attrs = slave_dev_attrs,
.name = "dev-properties", .name = "dev-properties",
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment