mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Peter Bergin <peter@berginkonsult.se>
Cc: <james.schulman@cirrus.com>, <david.rhodes@cirrus.com>,
	<tanureal@opensource.cirrus.com>, <rf@opensource.cirrus.com>,
	<broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	<alsa-devel@alsa-project.org>, <patches@opensource.cirrus.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] ASoC: cs42xx8-i2c.c: add module device table for of
Date: Fri, 28 Oct 2022 09:55:54 +0000	[thread overview]
Message-ID: <20221028095554.GG92394@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <20221028075045.493191-1-peter@berginkonsult.se>

On Fri, Oct 28, 2022 at 09:50:44AM +0200, Peter Bergin wrote:
> Matching of device in cs42xx8_i2c_probe() is coded with inspiration
> from tlv320aic32x4-i2c.c.
> ---
> +	if (i2c->dev.of_node) {
> +		const struct of_device_id *oid;
> +
> +		oid = of_match_node(cs42xx8_of_match, i2c->dev.of_node);
> +		if (!oid)
> +			goto err_not_found;
> +		drvdata = (struct cs42xx8_driver_data *)oid->data;
> +	} else {
> +		const struct i2c_device_id *id;
> +
> +		id = i2c_match_id(cs42xx8_i2c_id, i2c);
> +		if (!id)
> +			goto err_not_found;
> +		drvdata = (struct cs42xx8_driver_data *)id->driver_data;
> +	}

Be worth noting a little more explicitly in the commit message
you updated this logic as part of the move. I would even be
tempted to put it as a separate patch personally.

> +static const struct cs42xx8_driver_data cs42448_data = {
> +	.name = "cs42448",
> +	.num_adcs = 3,
> +};
> +
> +static const struct cs42xx8_driver_data cs42888_data = {
> +	.name = "cs42888",
> +	.num_adcs = 2,
> +};

It is probably better to leave these two structures exported from
the primary module. These devices could technically have SPI
support added in the future and it might as well reuse these same
data structures.

Thanks,
Charles

  reply	other threads:[~2022-10-28  9:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 11:50 [PATCH] ASoc: " Peter Bergin
2022-10-27 12:31 ` Mark Brown
2022-10-27 22:30 ` kernel test robot
2022-10-27 23:41 ` kernel test robot
2022-10-28  7:50 ` [PATCH v2] ASoC: " Peter Bergin
2022-10-28  9:55   ` Charles Keepax [this message]
2022-10-28 10:55   ` Mark Brown
2022-10-28 10:57     ` Peter Bergin

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=20221028095554.GG92394@ediswmail.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=david.rhodes@cirrus.com \
    --cc=james.schulman@cirrus.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=perex@perex.cz \
    --cc=peter@berginkonsult.se \
    --cc=rf@opensource.cirrus.com \
    --cc=tanureal@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    /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

all inboxes | Powered by JetHome®