Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Wolfram Sang <wsa@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>
Cc: "linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	linux-sound@vger.kernel.org
Subject: [PATCH v3 1/4] ALSA: ppc: Remove i2c client removal hack
Date: Fri, 1 Nov 2024 23:07:14 +0100	[thread overview]
Message-ID: <7f8156b6-b4fd-44f2-915a-5519f780bfdd@gmail.com> (raw)
In-Reply-To: <97970201-24fd-473d-b20a-d21d2cd468f3@gmail.com>

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>
---
 sound/ppc/keywest.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/sound/ppc/keywest.c b/sound/ppc/keywest.c
index 3d3513d9d..4ce81ac7f 100644
--- a/sound/ppc/keywest.c
+++ b/sound/ppc/keywest.c
@@ -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;
 	}
-- 
2.47.0



  reply	other threads:[~2024-11-01 22:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-01 22:05 [PATCH v3 0/4] i2c: Replace lists of special clients with flagging of such clients Heiner Kallweit
2024-11-01 22:07 ` Heiner Kallweit [this message]
2025-01-03 12:28   ` [PATCH v3 1/4] ALSA: ppc: Remove i2c client removal hack Wolfram Sang
2024-11-01 22:09 ` [PATCH v3 2/4] i2c: Replace list-based mechanism for handling auto-detected clients Heiner Kallweit
2025-01-03 12:29   ` Wolfram Sang
2025-02-04 15:24   ` Herve Codina
2025-02-04 20:00     ` Heiner Kallweit
2024-11-01 22:11 ` [PATCH v3 3/4] i2c: Replace list-based mechanism for handling userspace-created clients Heiner Kallweit
2025-01-03 12:35   ` Wolfram Sang
2024-11-01 22:12 ` [PATCH v3 4/4] i2c: core: Remove obsolete members of i2c_adapter and i2c_client Heiner Kallweit
2025-01-03 12:36   ` Wolfram Sang
2024-11-24 15:48 ` [PATCH v3 0/4] i2c: Replace lists of special clients with flagging of such clients Wolfram Sang
2025-01-03 12:38   ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f8156b6-b4fd-44f2-915a-5519f780bfdd@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox