All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] m68k: coldfire: return success for clk_enable(NULL)
@ 2021-07-29 12:27 Dan Carpenter
  2021-07-29 12:36 ` Marc Kleine-Budde
  2021-07-30  6:56 ` Greg Ungerer
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-07-29 12:27 UTC (permalink / raw)
  To: Greg Ungerer
  Cc: Geert Uytterhoeven, Defang Bo, Steven King, linux-m68k,
	linux-kernel, kernel-janitors, Marc Kleine-Budde,
	Christophe JAILLET

The clk_enable is supposed work when CONFIG_HAVE_CLK is false, but it
returns -EINVAL.  That means some drivers fail during probe.

[    1.680000] flexcan: probe of flexcan.0 failed with error -22

Fixes: c1fb1bf64bb6 ("m68k: let clk_enable() return immediately if clk is NULL")
Fixes: bea8bcb12da0 ("m68knommu: Add support for the Coldfire m5441x.")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I can't actually compile test this, but it's correct.

 arch/m68k/coldfire/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/coldfire/clk.c b/arch/m68k/coldfire/clk.c
index 2ed841e94111..d03b6c4aa86b 100644
--- a/arch/m68k/coldfire/clk.c
+++ b/arch/m68k/coldfire/clk.c
@@ -78,7 +78,7 @@ int clk_enable(struct clk *clk)
 	unsigned long flags;
 
 	if (!clk)
-		return -EINVAL;
+		return 0;
 
 	spin_lock_irqsave(&clk_lock, flags);
 	if ((clk->enabled++ == 0) && clk->clk_ops)
-- 
2.20.1


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

* Re: [PATCH] m68k: coldfire: return success for clk_enable(NULL)
  2021-07-29 12:27 [PATCH] m68k: coldfire: return success for clk_enable(NULL) Dan Carpenter
@ 2021-07-29 12:36 ` Marc Kleine-Budde
  2021-07-30  6:56 ` Greg Ungerer
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2021-07-29 12:36 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Ungerer, Geert Uytterhoeven, Defang Bo, Steven King,
	linux-m68k, linux-kernel, kernel-janitors, Christophe JAILLET

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

On 29.07.2021 15:27:03, Dan Carpenter wrote:
> The clk_enable is supposed work when CONFIG_HAVE_CLK is false, but it
> returns -EINVAL.  That means some drivers fail during probe.
> 
> [    1.680000] flexcan: probe of flexcan.0 failed with error -22
> 
> Fixes: c1fb1bf64bb6 ("m68k: let clk_enable() return immediately if clk is NULL")
> Fixes: bea8bcb12da0 ("m68knommu: Add support for the Coldfire m5441x.")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] m68k: coldfire: return success for clk_enable(NULL)
  2021-07-29 12:27 [PATCH] m68k: coldfire: return success for clk_enable(NULL) Dan Carpenter
  2021-07-29 12:36 ` Marc Kleine-Budde
@ 2021-07-30  6:56 ` Greg Ungerer
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Ungerer @ 2021-07-30  6:56 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Geert Uytterhoeven, Defang Bo, Steven King, linux-m68k,
	linux-kernel, kernel-janitors, Marc Kleine-Budde,
	Christophe JAILLET


On 29/7/21 10:27 pm, Dan Carpenter wrote:
> The clk_enable is supposed work when CONFIG_HAVE_CLK is false, but it
> returns -EINVAL.  That means some drivers fail during probe.
> 
> [    1.680000] flexcan: probe of flexcan.0 failed with error -22
> 
> Fixes: c1fb1bf64bb6 ("m68k: let clk_enable() return immediately if clk is NULL")
> Fixes: bea8bcb12da0 ("m68knommu: Add support for the Coldfire m5441x.")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks Dan.
Applied to the m68knommu git tree, for-next branch, with Marc's Acked-by added.

Regards
Greg


> ---
> I can't actually compile test this, but it's correct.
> 
>   arch/m68k/coldfire/clk.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/m68k/coldfire/clk.c b/arch/m68k/coldfire/clk.c
> index 2ed841e94111..d03b6c4aa86b 100644
> --- a/arch/m68k/coldfire/clk.c
> +++ b/arch/m68k/coldfire/clk.c
> @@ -78,7 +78,7 @@ int clk_enable(struct clk *clk)
>   	unsigned long flags;
>   
>   	if (!clk)
> -		return -EINVAL;
> +		return 0;
>   
>   	spin_lock_irqsave(&clk_lock, flags);
>   	if ((clk->enabled++ == 0) && clk->clk_ops)
> 

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

end of thread, other threads:[~2021-07-30  6:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 12:27 [PATCH] m68k: coldfire: return success for clk_enable(NULL) Dan Carpenter
2021-07-29 12:36 ` Marc Kleine-Budde
2021-07-30  6:56 ` Greg Ungerer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.