All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Wolfram Sang <wsa@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	linux-sound@vger.kernel.org
Subject: Re: [PATCH v3 3/4] i2c: Replace list-based mechanism for handling userspace-created clients
Date: Fri, 3 Jan 2025 13:35:39 +0100	[thread overview]
Message-ID: <Z3fZm_LkzQG1eP7b@shikoro> (raw)
In-Reply-To: <122c72c5-3bae-4c60-ad53-d8b4061db30d@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]

On Fri, Nov 01, 2024 at 11:11:39PM +0100, Heiner Kallweit wrote:
> Similar to the list of auto-detected clients, we can also replace the
> list of userspace-created clients with flagging such client devices.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>

Applied to for-next, thanks! Some edits:

> +	mutex_lock (&core_lock);

Superfluous space before parens. Fixed it and the other two occasions.

> +	child_dev = device_find_child(&adap->dev, &addr, __i2c_find_user_addr);
> +	if (!child_dev) {
> +		mutex_unlock (&core_lock);
> +		dev_err(dev, "Can't find userspace-created device at %#x\n", addr);
> +		return -ENOENT;
>  	}
> -	mutex_unlock(&adap->userspace_clients_lock);
> +	client = i2c_verify_client(child_dev);
> +	i2c_unregister_device(client);
> +	put_device(child_dev);
> +	mutex_unlock (&core_lock);

With locks, I really prefer to have a single exit point. Reordered the
code to:

	if (child_dev) {
		unreg
		put
	} else {
		dev_err
		count = -ENOENT
	}

and got rid of the 'client' variable while here which was only used
once.

> +#define I2C_CLIENT_USER		0x200	/* for board_info; userspace-created */

Like in the previous patch, I fixed the flag desc a little.

You might want to check my for-mergewindow branch to double check my
edits.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-01-03 12:35 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 ` [PATCH v3 1/4] ALSA: ppc: Remove i2c client removal hack Heiner Kallweit
2025-01-03 12:28   ` 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 [this message]
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=Z3fZm_LkzQG1eP7b@shikoro \
    --to=wsa+renesas@sang-engineering.com \
    --cc=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.