lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 28 Oct 2022 09:55:54 +0000
From:   Charles Keepax <ckeepax@...nsource.cirrus.com>
To:     Peter Bergin <peter@...ginkonsult.se>
CC:     <james.schulman@...rus.com>, <david.rhodes@...rus.com>,
        <tanureal@...nsource.cirrus.com>, <rf@...nsource.cirrus.com>,
        <broonie@...nel.org>, Liam Girdwood <lgirdwood@...il.com>,
        Jaroslav Kysela <perex@...ex.cz>,
        Takashi Iwai <tiwai@...e.com>, <alsa-devel@...a-project.org>,
        <patches@...nsource.cirrus.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] ASoC: cs42xx8-i2c.c: add module device table for of

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ