summaryrefslogtreecommitdiff
path: root/drivers/soundwire/sysfs_slave_dpn.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-30 10:46:31 -0800
committerVinod Koul <vkoul@kernel.org>2024-03-28 23:38:47 +0530
commitf88c1afe338edbcbfd23743742c45581075fb86c (patch)
tree25283401d999250227f1e8f7470cd0b7db1f01f7 /drivers/soundwire/sysfs_slave_dpn.c
parentfc7e56017b51482f1b9da2e778eedb4bd1deb6b3 (diff)
soundwire: sysfs: remove sdw_slave_sysfs_init()
Now that sdw_slave_sysfs_init() only calls sdw_slave_sysfs_dpn_init(), just do that instead and remove sdw_slave_sysfs_init() to get it out of the way to save a bit of logic and code size. 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-denatured-swaddling-b047@gregkh Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire/sysfs_slave_dpn.c')
-rw-r--r--drivers/soundwire/sysfs_slave_dpn.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/soundwire/sysfs_slave_dpn.c b/drivers/soundwire/sysfs_slave_dpn.c
index c4b6543c09fd..a3fb380ee519 100644
--- a/drivers/soundwire/sysfs_slave_dpn.c
+++ b/drivers/soundwire/sysfs_slave_dpn.c
@@ -283,6 +283,9 @@ int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave)
int ret;
int i;
+ if (!slave->prop.source_ports && !slave->prop.sink_ports)
+ return 0;
+
mask = slave->prop.source_ports;
for_each_set_bit(i, &mask, 32) {
ret = add_all_attributes(&slave->dev, i, 1);