diff mbox series

[RFC,v2,19/21] mmc: sdhi: use dev_err_probe when getting clock fails

Message ID 20211110191610.5664-20-wsa+renesas@sang-engineering.com (mailing list archive)
State New, archived
Headers show
Series clk/mmc: renesas_sdhi: refactor SDnH to be a separate clock | expand

Commit Message

Wolfram Sang Nov. 10, 2021, 7:16 p.m. UTC
This is to improve deferred probe in this driver and to keep consistent
with an up-to-date handling of a soon to be added second clock.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Changes since RFC v1:
* new patch

 drivers/mmc/host/renesas_sdhi_core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Ulf Hansson Nov. 11, 2021, 9:48 a.m. UTC | #1
On Wed, 10 Nov 2021 at 20:16, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> This is to improve deferred probe in this driver and to keep consistent
> with an up-to-date handling of a soon to be added second clock.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Acked-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe



> ---
> Changes since RFC v1:
> * new patch
>
>  drivers/mmc/host/renesas_sdhi_core.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index 4572242f9816..230182de5e88 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -916,11 +916,8 @@ int renesas_sdhi_probe(struct platform_device *pdev,
>         dma_priv = &priv->dma_priv;
>
>         priv->clk = devm_clk_get(&pdev->dev, NULL);
> -       if (IS_ERR(priv->clk)) {
> -               ret = PTR_ERR(priv->clk);
> -               dev_err(&pdev->dev, "cannot get clock: %d\n", ret);
> -               return ret;
> -       }
> +       if (IS_ERR(priv->clk))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk), "cannot get clock");
>
>         /*
>          * Some controllers provide a 2nd clock just to run the internal card
> --
> 2.30.2
>
Geert Uytterhoeven Nov. 12, 2021, 1:32 p.m. UTC | #2
On Wed, Nov 10, 2021 at 8:16 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> This is to improve deferred probe in this driver and to keep consistent
> with an up-to-date handling of a soon to be added second clock.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v5.17.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Geert Uytterhoeven Nov. 12, 2021, 1:33 p.m. UTC | #3
CC clk

On Fri, Nov 12, 2021 at 2:32 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Wed, Nov 10, 2021 at 8:16 PM Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
> > This is to improve deferred probe in this driver and to keep consistent
> > with an up-to-date handling of a soon to be added second clock.
> >
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> i.e. will queue in renesas-devel for v5.17.

Oops, renesas-clk-for-v5.17.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 4572242f9816..230182de5e88 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -916,11 +916,8 @@  int renesas_sdhi_probe(struct platform_device *pdev,
 	dma_priv = &priv->dma_priv;
 
 	priv->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(priv->clk)) {
-		ret = PTR_ERR(priv->clk);
-		dev_err(&pdev->dev, "cannot get clock: %d\n", ret);
-		return ret;
-	}
+	if (IS_ERR(priv->clk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk), "cannot get clock");
 
 	/*
 	 * Some controllers provide a 2nd clock just to run the internal card