[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f21272719a3983bda647147e8460615159875b1.camel@perches.com>
Date: Mon, 24 May 2021 17:07:17 -0700
From: Joe Perches <joe@...ches.com>
To: Jerome Brunet <jbrunet@...libre.com>,
Mark Brown <broonie@...nel.org>
Cc: alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
linux-amlogic@...ts.infradead.org
Subject: Re: [PATCH] ASoC: meson: use dev_err_probe
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...
Powered by blists - more mailing lists