ASoC: SDCA: Rename SoundWire struct device variables

The SDCA core processes two different struct device's at various times,
usually it is processing the struct device associated with an individual
SDCA Function driver. However, there are times that it is processing the
struct device associated with the actual SoundWire peripheral, usually
the parent of the Function device.

To ensure this distinction remains clear in the code, rename the variable
when handling the actual SoundWire device to sdev.

Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20251020155512.353774-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Charles Keepax
2025-10-20 16:54:54 +01:00
committed by Mark Brown
parent c17fa4cbc5
commit 715159314d
2 changed files with 10 additions and 10 deletions

View File

@@ -179,11 +179,11 @@ static int find_sdca_function(struct acpi_device *adev, void *data)
*/
void sdca_lookup_functions(struct sdw_slave *slave)
{
struct device *dev = &slave->dev;
struct acpi_device *adev = to_acpi_device_node(dev->fwnode);
struct device *sdev = &slave->dev;
struct acpi_device *adev = to_acpi_device_node(sdev->fwnode);
if (!adev) {
dev_info(dev, "no matching ACPI device found, ignoring peripheral\n");
dev_info(sdev, "no matching ACPI device found, ignoring peripheral\n");
return;
}

View File

@@ -400,7 +400,7 @@ EXPORT_SYMBOL_NS_GPL(sdca_irq_populate, "SND_SOC_SDCA");
/**
* sdca_irq_allocate - allocate an SDCA interrupt structure for a device
* @dev: Device pointer against which things should be allocated.
* @sdev: Device pointer against which things should be allocated.
* @regmap: regmap to be used for accessing the SDCA IRQ registers.
* @irq: The interrupt number.
*
@@ -411,30 +411,30 @@ EXPORT_SYMBOL_NS_GPL(sdca_irq_populate, "SND_SOC_SDCA");
* Return: A pointer to the allocated sdca_interrupt_info struct, or an
* error code.
*/
struct sdca_interrupt_info *sdca_irq_allocate(struct device *dev,
struct sdca_interrupt_info *sdca_irq_allocate(struct device *sdev,
struct regmap *regmap, int irq)
{
struct sdca_interrupt_info *info;
int ret;
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
info = devm_kzalloc(sdev, sizeof(*info), GFP_KERNEL);
if (!info)
return ERR_PTR(-ENOMEM);
info->irq_chip = sdca_irq_chip;
ret = devm_mutex_init(dev, &info->irq_lock);
ret = devm_mutex_init(sdev, &info->irq_lock);
if (ret)
return ERR_PTR(ret);
ret = devm_regmap_add_irq_chip(dev, regmap, irq, IRQF_ONESHOT, 0,
ret = devm_regmap_add_irq_chip(sdev, regmap, irq, IRQF_ONESHOT, 0,
&info->irq_chip, &info->irq_data);
if (ret) {
dev_err(dev, "failed to register irq chip: %d\n", ret);
dev_err(sdev, "failed to register irq chip: %d\n", ret);
return ERR_PTR(ret);
}
dev_dbg(dev, "registered on irq %d\n", irq);
dev_dbg(sdev, "registered on irq %d\n", irq);
return info;
}