ASoC: tlv320aic26: remove keyclick sysfs file

aic26_probe() creates the keyclick sysfs file on the component device.
The file callback uses the ASoC component pointer stored in the driver
private data.

There is no matching remove callback, so the sysfs file can remain after
the component is removed while its backing component state is gone.

Add a component remove callback that removes the keyclick file.

Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260615064549.34110-1-pengpeng@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pengpeng Hou 2026-06-15 14:45:48 +08:00 committed by Mark Brown
parent ce3733792d
commit ae375f8d06
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -320,8 +320,14 @@ static int aic26_probe(struct snd_soc_component *component)
return 0;
}
static void aic26_remove(struct snd_soc_component *component)
{
device_remove_file(component->dev, &dev_attr_keyclick);
}
static const struct snd_soc_component_driver aic26_soc_component_dev = {
.probe = aic26_probe,
.remove = aic26_remove,
.controls = aic26_snd_controls,
.num_controls = ARRAY_SIZE(aic26_snd_controls),
.dapm_widgets = tlv320aic26_dapm_widgets,