summaryrefslogtreecommitdiff
path: root/drivers/soundwire/sysfs_slave.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-30 10:46:30 -0800
committerVinod Koul <vkoul@kernel.org>2024-03-28 23:38:47 +0530
commitfc7e56017b51482f1b9da2e778eedb4bd1deb6b3 (patch)
tree48e6fbde729a97a49abce8527586c8704036fdaa /drivers/soundwire/sysfs_slave.c
parent3ee43f7cc9841cdf3f2bec2de4b1e729fd17e303 (diff)
downloadlwn-fc7e56017b51482f1b9da2e778eedb4bd1deb6b3.tar.gz
lwn-fc7e56017b51482f1b9da2e778eedb4bd1deb6b3.zip
soundwire: sysfs: have the driver core handle the creation of the device groups
The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Take advantage of that by converting this driver to use this by moving the sysfs attributes into a group and assigning the dev_groups pointer to it. 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> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Tested-By: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/2024013030-worsening-rocket-a3cb@gregkh Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire/sysfs_slave.c')
-rw-r--r--drivers/soundwire/sysfs_slave.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c
index 8876c7807048..3afc0dc06c98 100644
--- a/drivers/soundwire/sysfs_slave.c
+++ b/drivers/soundwire/sysfs_slave.c
@@ -214,7 +214,7 @@ static const struct attribute_group dp0_group = {
.name = "dp0",
};
-static const struct attribute_group *slave_groups[] = {
+const struct attribute_group *sdw_attr_groups[] = {
&slave_attr_group,
&sdw_slave_dev_attr_group,
&dp0_group,
@@ -225,10 +225,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave)
{
int ret;
- ret = devm_device_add_groups(&slave->dev, slave_groups);
- if (ret < 0)
- return ret;
-
if (slave->prop.source_ports || slave->prop.sink_ports) {
ret = sdw_slave_sysfs_dpn_init(slave);
if (ret < 0)