mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH v1] clk: meson: axg-audio: Use dev_err_probe() to simplfy code
@ 2024-08-30  8:01 Chen Yufan
  2024-08-30 14:46 ` Jerome Brunet
  0 siblings, 1 reply; 3+ messages in thread
From: Chen Yufan @ 2024-08-30  8:01 UTC (permalink / raw)
  To: Neil Armstrong, Jerome Brunet, Michael Turquette, Stephen Boyd,
	Kevin Hilman, Martin Blumenstingl, linux-amlogic, linux-clk,
	linux-arm-kernel, linux-kernel
  Cc: opensource.kernel, Chen Yufan

Use dev_err_probe() can make code a bit simpler.

Signed-off-by: Chen Yufan <chenyufan@vivo.com>
---
 drivers/clk/meson/axg-audio.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
index e03a5bf899c0..0637b05a4c89 100644
--- a/drivers/clk/meson/axg-audio.c
+++ b/drivers/clk/meson/axg-audio.c
@@ -1761,10 +1761,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
 		return PTR_ERR(regs);
 
 	map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg);
-	if (IS_ERR(map)) {
-		dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map));
-		return PTR_ERR(map);
-	}
+	if (IS_ERR(map))
+		return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap: %ld\n");
 
 	/* Get the mandatory peripheral clock */
 	clk = devm_clk_get_enabled(dev, "pclk");
@@ -1772,10 +1770,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
 		return PTR_ERR(clk);
 
 	ret = device_reset(dev);
-	if (ret) {
-		dev_err_probe(dev, ret, "failed to reset device\n");
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to reset device\n");
 
 	/* Populate regmap for the regmap backed clocks */
 	for (i = 0; i < data->regmap_clk_num; i++)
-- 
2.39.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] clk: meson: axg-audio: Use dev_err_probe() to simplfy code
  2024-08-30  8:01 [PATCH v1] clk: meson: axg-audio: Use dev_err_probe() to simplfy code Chen Yufan
@ 2024-08-30 14:46 ` Jerome Brunet
  2024-08-30 17:46   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Jerome Brunet @ 2024-08-30 14:46 UTC (permalink / raw)
  To: Chen Yufan
  Cc: Neil Armstrong, Michael Turquette, Stephen Boyd, Kevin Hilman,
	Martin Blumenstingl, linux-amlogic, linux-clk, linux-arm-kernel,
	linux-kernel, opensource.kernel

On Fri 30 Aug 2024 at 16:01, Chen Yufan <chenyufan@vivo.com> wrote:

> Use dev_err_probe() can make code a bit simpler.

It surely does but ...

>
> Signed-off-by: Chen Yufan <chenyufan@vivo.com>
> ---
>  drivers/clk/meson/axg-audio.c | 12 ++++--------

Why this driver alone ?

I have nothing against the change you are doing but I would not want to get a
single patch for each and every amlogic clock drivers.

>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
> index e03a5bf899c0..0637b05a4c89 100644
> --- a/drivers/clk/meson/axg-audio.c
> +++ b/drivers/clk/meson/axg-audio.c
> @@ -1761,10 +1761,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
>  		return PTR_ERR(regs);
>  
>  	map = devm_regmap_init_mmio(dev, regs, &axg_audio_regmap_cfg);
> -	if (IS_ERR(map)) {
> -		dev_err(dev, "failed to init regmap: %ld\n", PTR_ERR(map));
> -		return PTR_ERR(map);
> -	}
> +	if (IS_ERR(map))
> +		return dev_err_probe(dev, PTR_ERR(map), "failed to init regmap: %ld\n");

This does not inspire a lot of confidence. Did you perfom any test
before sending this ?

I know you sent a v2 fixing this, but still ...

>  
>  	/* Get the mandatory peripheral clock */
>  	clk = devm_clk_get_enabled(dev, "pclk");
> @@ -1772,10 +1770,8 @@ static int axg_audio_clkc_probe(struct platform_device *pdev)
>  		return PTR_ERR(clk);
>  
>  	ret = device_reset(dev);
> -	if (ret) {
> -		dev_err_probe(dev, ret, "failed to reset device\n");
> -		return ret;
> -	}
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to reset device\n");
>  
>  	/* Populate regmap for the regmap backed clocks */
>  	for (i = 0; i < data->regmap_clk_num; i++)

Finally, it does not apply on my tree.
Check the PR sent to Stephen, you'll get all the details.

https://lore.kernel.org/linux-clk/1jjzfyrsbh.fsf@starbuckisacylon.baylibre.com/

-- 
Jerome

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] clk: meson: axg-audio: Use dev_err_probe() to simplfy code
  2024-08-30 14:46 ` Jerome Brunet
@ 2024-08-30 17:46   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2024-08-30 17:46 UTC (permalink / raw)
  To: Jerome Brunet, Chen Yufan
  Cc: Neil Armstrong, Michael Turquette, Stephen Boyd, Kevin Hilman,
	Martin Blumenstingl, linux-amlogic, linux-clk, linux-arm-kernel,
	linux-kernel, opensource.kernel

On 30/08/2024 16:46, Jerome Brunet wrote:
> On Fri 30 Aug 2024 at 16:01, Chen Yufan <chenyufan@vivo.com> wrote:
> 
>> Use dev_err_probe() can make code a bit simpler.
> 
> It surely does but ...
> 
>>
>> Signed-off-by: Chen Yufan <chenyufan@vivo.com>
>> ---
>>  drivers/clk/meson/axg-audio.c | 12 ++++--------
> 
> Why this driver alone ?
> 
> I have nothing against the change you are doing but I would not want to get a
> single patch for each and every amlogic clock drivers.
> 

Look here:
https://lore.kernel.org/all/?q=f:@vivo.com
There is a like a flood of trivial patches started last two weeks. Not
sure if there is any coordination, any oversight or review. Few trivial
ones were introducing bugs, so I suggest caution.

Best regards,
Krzysztof


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-30 17:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-30  8:01 [PATCH v1] clk: meson: axg-audio: Use dev_err_probe() to simplfy code Chen Yufan
2024-08-30 14:46 ` Jerome Brunet
2024-08-30 17:46   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome