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:	Tue, 9 Jun 2015 18:07:38 +0100
From:	Mark Brown <broonie@...nel.org>
To:	Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:	alsa-devel@...a-project.org, Rob Herring <robh+dt@...nel.org>,
	Patrick Lai <plai@...eaurora.org>,
	Banajit Goswami <bgoswami@...eaurora.org>,
	Liam Girdwood <lgirdwood@...il.com>,
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	kwestfie@...eaurora.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v5 2/2] ASoC: qcom: add apq8016 sound card support

On Tue, Jun 09, 2015 at 01:59:36PM +0100, Srinivas Kandagatla wrote:

> +	if (cpu_dai->id == MI2S_QUATERNARY) {
> +		/* Configure the Quat MI2S to TLMM */
> +		writel(readl(pdata->mic_iomux) |
> +			MIC_CTRL_QUA_WS_SLAVE_SEL_10 |
> +			MIC_CTRL_TLMM_SCLK_EN,
> +			pdata->mic_iomux);
> +
> +		return 0;
> +	} else if (cpu_dai->id == MI2S_PRIMARY) {
> +		writel(readl(pdata->spkr_iomux) |
> +			SPKR_CTL_PRI_WS_SLAVE_SEL_11,
> +			pdata->spkr_iomux);
> +
> +		return 0;
> +	}

Why not just do these one time at probe, we don't undo them when we shut
the DAI down?

> +
> +	dev_err(card->dev, "unsupported cpu dai configuration\n");
> +
> +	return -EINVAL;

It'd be clearer if this were part of the above code (which should still
be written as a switch statement) - I was just asking myself what
happens if we fall off the end of the if/else chain.

> +		/**
> +		 * External codec is ADV7533
> +		 * and internal codec digital part is inside apq8016
> +		 * and analog part is in PMIC PM8916
> +		 **/
> +		if (of_property_read_bool(np, "external"))
> +			name = "ADV7533";
> +		else
> +			name = "WCD";

If this is all the property is doing why not just put a link name
property in the DT rather than this?  That makes the driver a bit more
general and is more idiomatic.

> +		dai_link->name = dai_link->stream_name = name;

Write two assignment statements, it's clearer and more idiomatic.

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ