Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion drivers/soundwire/master.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ int sdw_master_device_add(struct sdw_bus *bus, struct device *parent,
md->dev.parent = parent;
md->dev.groups = master_node_groups;
md->dev.of_node = parent->of_node;
md->dev.fwnode = fwnode;
md->dev.dma_mask = parent->dma_mask;

dev_set_name(&md->dev, "sdw-master-%d", bus->id);
/* make sure ACPI companion is set based on parent */
ACPI_COMPANION_SET(&md->dev, ACPI_COMPANION(parent));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this is really necessary?
Do we hit any issues without this?

Also this wouldn't work for Qualcomm (not using ACPI), I think we have to use set_primary_fwnode() directly.


ret = device_register(&md->dev);
if (ret) {
Expand Down
4 changes: 3 additions & 1 deletion drivers/soundwire/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ int sdw_slave_add(struct sdw_bus *bus,
/* Initialize data structure */
memcpy(&slave->id, id, sizeof(*id));
slave->dev.parent = bus->dev;
slave->dev.fwnode = fwnode;

if (id->unique_id == SDW_IGNORED_UNIQUE_ID) {
/* name shall be sdw:link:mfg:part:class */
Expand All @@ -53,6 +52,9 @@ int sdw_slave_add(struct sdw_bus *bus,
slave->dev.of_node = of_node_get(to_of_node(fwnode));
slave->dev.type = &sdw_slave_type;
slave->dev.groups = sdw_slave_status_attr_groups;
/* To make sure fwnode is a primary fwnode */
fwnode->secondary = NULL;
set_primary_fwnode(&slave->dev, fwnode);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message needs to be updated, e.g.

Properties may be added to a codec as a secondary fwnode. When the slave device is removed, the fwnode remains tagged as secondary, which causes a side effect if the slave device is re-added in module load/unload tests. Forcing the fwnode as primary is required, otherwise the dev->fwnode will be overridden with the properties.

slave->bus = bus;
slave->status = SDW_SLAVE_UNATTACHED;
init_completion(&slave->enumeration_complete);
Expand Down