Re: [PATCH] ASoC: meson: use dev_err_probe

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

 



On Mon, 2021-05-24 at 18:51 +0200, Jerome Brunet wrote:
> Use dev_err_probe() helper function to handle probe deferral.
> It removes the open coded test for -EPROBE_DEFER but more importantly, it
> sets the deferral reason in debugfs which is great for debugging.

trivia:

It seems that the use of %ld, PTR_ERR(<foo>) isn't particularly
useful now as dev_err_probe already uses %pe to emit descriptive
error messages.


> diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c
[]
> @@ -352,17 +352,16 @@ int axg_fifo_probe(struct platform_device *pdev)
>  
> 
>  	fifo->pclk = devm_clk_get(dev, NULL);
>  	if (IS_ERR(fifo->pclk)) {
> -		if (PTR_ERR(fifo->pclk) != -EPROBE_DEFER)
> -			dev_err(dev, "failed to get pclk: %ld\n",
> -				PTR_ERR(fifo->pclk));
> +		dev_err_probe(dev, PTR_ERR(fifo->pclk),
> +			      "failed to get pclk: %ld\n", PTR_ERR(fifo->pclk));

here.

>  		return PTR_ERR(fifo->pclk);
>  	}
>  
> 
>  	fifo->arb = devm_reset_control_get_exclusive(dev, NULL);
>  	if (IS_ERR(fifo->arb)) {
> -		if (PTR_ERR(fifo->arb) != -EPROBE_DEFER)
> -			dev_err(dev, "failed to get arb reset: %ld\n",
> -				PTR_ERR(fifo->arb));
> +		dev_err_probe(dev, PTR_ERR(fifo->arb),
> +			      "failed to get arb reset: %ld\n",
> +			      PTR_ERR(fifo->arb));

etc...





[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux