ALSA: ppc: Remove i2c client removal hack

JIRA: https://issues.redhat.com/browse/RHEL-80658

Omitted-fix: 56a50667cbcfaf95eea9128d5676af94e54b51a8
             i2c: Replace list-based mechanism for handling auto-detected clients
             outside sound/ tree
Omitted-fix: 3cfe39b3a845593a485ab1c716615979004ef9f6
             i2c: Replace list-based mechanism for handling userspace-created clients
             outside sound/ tree

commit 60be800603ff81d43b2fbb3c067bbef49f7d8414
Author: Heiner Kallweit <hkallweit1@gmail.com>
Date: Fri Nov 1 23:07:14 2024 +0100

    ALSA: ppc: Remove i2c client removal hack

    The i2c_driver.clients list is internal to I2C core and is going
    to be removed.  No driver should access it. Unregister the
    i2c client explicitly before deleting the i2c driver.

    Reviewed-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
    Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>
This commit is contained in:
Jaroslav Kysela 2025-05-26 14:47:36 +02:00
parent 98516a3d38
commit c42cc1f393
1 changed files with 1 additions and 6 deletions

View File

@ -61,12 +61,6 @@ static int keywest_attach_adapter(struct i2c_adapter *adapter)
return -ENODEV;
}
/*
* Let i2c-core delete that device on driver removal.
* This is safe because i2c-core holds the core_lock mutex for us.
*/
list_add_tail(&keywest_ctx->client->detected,
&to_i2c_driver(keywest_ctx->client->dev.driver)->clients);
return 0;
}
@ -99,6 +93,7 @@ static struct i2c_driver keywest_driver = {
void snd_pmac_keywest_cleanup(struct pmac_keywest *i2c)
{
if (keywest_ctx && keywest_ctx == i2c) {
i2c_unregister_device(keywest_ctx->client);
i2c_del_driver(&keywest_driver);
keywest_ctx = NULL;
}