Re: [PATCH RFC v2 REPOST 2/8] ASoC: davinci-evm: Add named clock reference to DT bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, Dec 20, 2013 at 12:38:27PM +0200, Jyri Sarha wrote:

> +static int evm_startup(struct snd_pcm_substream *substream)
> +{
> +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> +	struct snd_soc_card *soc_card = rtd->codec->card;
> +	struct clk *mclk = ((struct snd_soc_card_drvdata_davinci *)
> +			    snd_soc_card_get_drvdata(soc_card))->mclk;

Why do you need to cast away void?  Ths indicates something is going
wrong here though I can't see what.

> +	mclk = of_clk_get_by_name(np, "ti,codec-clock");
> +	if (PTR_ERR(mclk) == -EPROBE_DEFER) {
> +		return -EPROBE_DEFER;
> +	} else if (IS_ERR(mclk)) {
> +		dev_dbg(&pdev->dev, "Codec clock not found.\n");
> +		mclk = NULL;
> +	}

The driver will unconditionally enable and disable the clock which I'd
not expect to work well if we got an error, I'd expect either NULL checks 
on use or a fixed clock to be registered from code in the case where
we're using the old binding.

I'd also expect to see devm_clk_get() used here, with the standard
clock-names based lookup from DT.

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux