[alsa-devel] [PATCH 03/14] soundwire: Add Master registration

Mark Brown broonie at kernel.org
Sat Oct 21 11:12:30 CEST 2017


On Thu, Oct 19, 2017 at 08:33:19AM +0530, Vinod Koul wrote:

> +	/*
> +	 * SDW is an enumerable bus, but devices can be powered off. So,
> +	 * they won't be able to report as present.
> +	 *
> +	 * Create Slave devices based on Slaves described in
> +	 * the respective firmware (ACPI/DT)
> +	 */
> +
> +	if (IS_ENABLED(CONFIG_ACPI) && bus->dev && ACPI_HANDLE(bus->dev))
> +		ret = sdw_acpi_find_slaves(bus);
> +	else if (IS_ENABLED(CONFIG_OF) && bus->dev && bus->dev->of_node)
> +		ret = sdw_of_find_slaves(bus);
> +	else
> +		ret = -ENOTSUPP; /* No ACPI/DT so error out */

Devices *can* be powered off but is there any reason that a system
couldn't be designed with them always powered?  Also given that we don't
actually have any DT support the stubs for it are at best misleading,
it's not going to be hard for someone to add them later.

> +	mutex_lock(&bus->bus_lock);
> +	if (!list_empty(&bus->slaves))
> +		list_del(&slave->node);

Shouldn't that be a while?  Or at least warn if there's anything extra
there.  The code just looks very wrong as is.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20171021/38c87080/attachment.sig>


More information about the Alsa-devel mailing list