* [PATCH] mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock
@ 2021-11-16 13:36 Geert Uytterhoeven
2021-11-16 19:27 ` Wolfram Sang
2021-11-22 11:25 ` Ulf Hansson
0 siblings, 2 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-11-16 13:36 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: linux-mmc, linux-renesas-soc, Geert Uytterhoeven
Use the existing devm_clk_get_optional() helper to obtain the optional
Card Detect clock, instead of open-coding the same operation.
a side effect, real errors will now be handled correctly instead of
being ignored.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/mmc/host/renesas_sdhi_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index a6c47362035a0415..f41225a34f4ae863 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -936,9 +936,9 @@ int renesas_sdhi_probe(struct platform_device *pdev,
* to the card detect circuit. That leaves us with if separate clocks
* are presented, we must treat them both as virtually 1 clock.
*/
- priv->clk_cd = devm_clk_get(&pdev->dev, "cd");
+ priv->clk_cd = devm_clk_get_optional(&pdev->dev, "cd");
if (IS_ERR(priv->clk_cd))
- priv->clk_cd = NULL;
+ return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk_cd), "cannot get cd clock");
priv->pinctrl = devm_pinctrl_get(&pdev->dev);
if (!IS_ERR(priv->pinctrl)) {
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock
2021-11-16 13:36 [PATCH] mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock Geert Uytterhoeven
@ 2021-11-16 19:27 ` Wolfram Sang
2021-11-22 11:25 ` Ulf Hansson
1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2021-11-16 19:27 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Ulf Hansson, linux-mmc, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 448 bytes --]
On Tue, Nov 16, 2021 at 02:36:07PM +0100, Geert Uytterhoeven wrote:
> Use the existing devm_clk_get_optional() helper to obtain the optional
> Card Detect clock, instead of open-coding the same operation.
> a side effect, real errors will now be handled correctly instead of
> being ignored.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Thanks, Geert!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock
2021-11-16 13:36 [PATCH] mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock Geert Uytterhoeven
2021-11-16 19:27 ` Wolfram Sang
@ 2021-11-22 11:25 ` Ulf Hansson
2021-11-23 9:31 ` Geert Uytterhoeven
1 sibling, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2021-11-22 11:25 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Wolfram Sang, linux-mmc, linux-renesas-soc
On Tue, 16 Nov 2021 at 14:36, Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> Use the existing devm_clk_get_optional() helper to obtain the optional
> Card Detect clock, instead of open-coding the same operation.
> a side effect, real errors will now be handled correctly instead of
> being ignored.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
I guess it's best if you continue to funnel renesas_sdhi changes
through your tree for the current cycle, to avoid conflicts. Right?
Kind regards
Uffe
> ---
> drivers/mmc/host/renesas_sdhi_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index a6c47362035a0415..f41225a34f4ae863 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -936,9 +936,9 @@ int renesas_sdhi_probe(struct platform_device *pdev,
> * to the card detect circuit. That leaves us with if separate clocks
> * are presented, we must treat them both as virtually 1 clock.
> */
> - priv->clk_cd = devm_clk_get(&pdev->dev, "cd");
> + priv->clk_cd = devm_clk_get_optional(&pdev->dev, "cd");
> if (IS_ERR(priv->clk_cd))
> - priv->clk_cd = NULL;
> + return dev_err_probe(&pdev->dev, PTR_ERR(priv->clk_cd), "cannot get cd clock");
>
> priv->pinctrl = devm_pinctrl_get(&pdev->dev);
> if (!IS_ERR(priv->pinctrl)) {
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock
2021-11-22 11:25 ` Ulf Hansson
@ 2021-11-23 9:31 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-11-23 9:31 UTC (permalink / raw)
To: Ulf Hansson
Cc: Wolfram Sang, linux-mmc, linux-renesas-soc, Michael Turquette,
Stephen Boyd
Hi Ulf,
On Mon, Nov 22, 2021 at 12:26 PM Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On Tue, 16 Nov 2021 at 14:36, Geert Uytterhoeven
> <geert+renesas@glider.be> wrote:
> >
> > Use the existing devm_clk_get_optional() helper to obtain the optional
> > Card Detect clock, instead of open-coding the same operation.
> > a side effect, real errors will now be handled correctly instead of
> > being ignored.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Thanks!
> I guess it's best if you continue to funnel renesas_sdhi changes
> through your tree for the current cycle, to avoid conflicts. Right?
Sure, will queue in 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-11-23 9:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-16 13:36 [PATCH] mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock Geert Uytterhoeven
2021-11-16 19:27 ` Wolfram Sang
2021-11-22 11:25 ` Ulf Hansson
2021-11-23 9:31 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox