alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups
@ 2022-07-29 13:50 Greg Kroah-Hartman
  2022-07-29 13:50 ` [PATCH 2/5] soundwire: sysfs: cleanup the logic for creating the dp0 sysfs attributes Greg Kroah-Hartman
                   ` (4 more replies)
  0 siblings, 5 replies; 24+ messages in thread
From: Greg Kroah-Hartman @ 2022-07-29 13:50 UTC (permalink / raw)
  To: alsa-devel
  Cc: Greg Kroah-Hartman, Pierre-Louis Bossart, linux-kernel,
	Vinod Koul, Sanyog Kale, Bard Liao

The sysfs logic already creates a list of groups for the device, so add
the sdw_slave_dev_attr_group group to that list instead of having to do
a two-step process of adding a group list and then an individual group.

This is a step on the way to moving all of the sysfs attribute handling
into the default driver core attribute group logic so that the soundwire
core does not have to do any of it manually.

Cc: Vinod Koul <vkoul@kernel.org>
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Sanyog Kale <sanyog.r.kale@intel.com>
Cc: alsa-devel@alsa-project.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/soundwire/sysfs_slave.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c
index 3210359cd944..83e3f6cc3250 100644
--- a/drivers/soundwire/sysfs_slave.c
+++ b/drivers/soundwire/sysfs_slave.c
@@ -105,7 +105,10 @@ static struct attribute *slave_attrs[] = {
 	&dev_attr_modalias.attr,
 	NULL,
 };
-ATTRIBUTE_GROUPS(slave);
+
+static const struct attribute_group slave_attr_group = {
+	.attrs = slave_attrs,
+};
 
 static struct attribute *slave_dev_attrs[] = {
 	&dev_attr_mipi_revision.attr,
@@ -190,6 +193,12 @@ static const struct attribute_group dp0_group = {
 	.name = "dp0",
 };
 
+static const struct attribute_group *slave_groups[] = {
+	&slave_attr_group,
+	&sdw_slave_dev_attr_group,
+	NULL,
+};
+
 int sdw_slave_sysfs_init(struct sdw_slave *slave)
 {
 	int ret;
@@ -198,10 +207,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave)
 	if (ret < 0)
 		return ret;
 
-	ret = devm_device_add_group(&slave->dev, &sdw_slave_dev_attr_group);
-	if (ret < 0)
-		return ret;
-
 	if (slave->prop.dp0_prop) {
 		ret = devm_device_add_group(&slave->dev, &dp0_group);
 		if (ret < 0)
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2022-08-24 14:05 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-29 13:50 [PATCH 1/5] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups Greg Kroah-Hartman
2022-07-29 13:50 ` [PATCH 2/5] soundwire: sysfs: cleanup the logic for creating the dp0 sysfs attributes Greg Kroah-Hartman
2022-07-29 14:46   ` Pierre-Louis Bossart
2022-07-29 14:52     ` Greg Kroah-Hartman
2022-07-29 14:57       ` Pierre-Louis Bossart
2022-07-29 15:03         ` Greg Kroah-Hartman
2022-07-29 15:52           ` Pierre-Louis Bossart
2022-07-29 16:35             ` Greg Kroah-Hartman
2022-07-29 16:46               ` Pierre-Louis Bossart
2022-07-29 17:15                 ` Greg Kroah-Hartman
2022-07-29 17:25                   ` Pierre-Louis Bossart
2022-08-24 13:55                 ` Greg Kroah-Hartman
2022-08-03 11:30           ` Vinod Koul
2022-07-29 13:50 ` [PATCH 3/5] soundwire: sysfs: have the driver core handle the creation of the device groups Greg Kroah-Hartman
2022-07-29 14:12   ` Pierre-Louis Bossart
2022-07-29 14:19     ` Greg Kroah-Hartman
2022-07-29 13:50 ` [PATCH 4/5] soundwire: sysfs: remove sdw_slave_sysfs_init() Greg Kroah-Hartman
2022-07-29 15:00   ` Pierre-Louis Bossart
2022-07-29 15:13     ` Greg Kroah-Hartman
2022-08-03 11:33       ` Vinod Koul
2022-07-29 13:50 ` [PATCH 5/5] soundwire: sysfs: remove unneeded ATTRIBUTE_GROUPS() comments Greg Kroah-Hartman
2022-08-23 16:00 ` [PATCH 1/5] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups Vinod Koul
2022-08-24  6:18   ` Greg Kroah-Hartman
2022-08-24 14:04   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).