Skip to content

Commit

Permalink
ALSA: ppc: Remove i2c client removal hack
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Heiner Kallweit <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
  • Loading branch information
hkallweit authored and Wolfram Sang committed Jan 3, 2025
1 parent fc033cf commit 60be800
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions sound/ppc/keywest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 60be800

Please sign in to comment.