Skip to content

Commit f88c1af

Browse files
gregkhvinodkoul
authored andcommitted
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 <[email protected]> Cc: Bard Liao <[email protected]> Cc: Pierre-Louis Bossart <[email protected]> Cc: Sanyog Kale <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Dan Williams <[email protected]> Tested-By: Vijendar Mukunda <[email protected]> Link: https://lore.kernel.org/r/2024013030-denatured-swaddling-b047@gregkh Signed-off-by: Vinod Koul <[email protected]>
1 parent fc7e560 commit f88c1af

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

drivers/soundwire/bus_type.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ static int sdw_drv_probe(struct device *dev)
126126
if (slave->prop.use_domain_irq)
127127
sdw_irq_create_mapping(slave);
128128

129-
/* init the sysfs as we have properties now */
130-
ret = sdw_slave_sysfs_init(slave);
129+
/* init the dynamic sysfs attributes we need */
130+
ret = sdw_slave_sysfs_dpn_init(slave);
131131
if (ret < 0)
132132
dev_warn(dev, "Slave sysfs init failed:%d\n", ret);
133133

drivers/soundwire/sysfs_local.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ extern const struct attribute_group *sdw_slave_status_attr_groups[];
1515
extern const struct attribute_group *sdw_attr_groups[];
1616

1717
/* additional device-managed properties reported after driver probe */
18-
int sdw_slave_sysfs_init(struct sdw_slave *slave);
1918
int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave);
2019

2120
#endif /* __SDW_SYSFS_LOCAL_H */

drivers/soundwire/sysfs_slave.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -221,19 +221,6 @@ const struct attribute_group *sdw_attr_groups[] = {
221221
NULL,
222222
};
223223

224-
int sdw_slave_sysfs_init(struct sdw_slave *slave)
225-
{
226-
int ret;
227-
228-
if (slave->prop.source_ports || slave->prop.sink_ports) {
229-
ret = sdw_slave_sysfs_dpn_init(slave);
230-
if (ret < 0)
231-
return ret;
232-
}
233-
234-
return 0;
235-
}
236-
237224
/*
238225
* the status is shown in capital letters for UNATTACHED and RESERVED
239226
* on purpose, to highligh users to the fact that these status values

drivers/soundwire/sysfs_slave_dpn.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave)
283283
int ret;
284284
int i;
285285

286+
if (!slave->prop.source_ports && !slave->prop.sink_ports)
287+
return 0;
288+
286289
mask = slave->prop.source_ports;
287290
for_each_set_bit(i, &mask, 32) {
288291
ret = add_all_attributes(&slave->dev, i, 1);

0 commit comments

Comments
 (0)