Skip to contentSkip to conversation

m68k: coldfire: return success for clk_enable(NULL)

PATCH In review Dan Carpenter 3 participants 3 messages Jul 29, 2021 – Jul 30, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k: coldfire: return success for clk_enable(NULL)

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.")

---
I can't actually compile test this, but it's correct.

 arch/m68k/coldfire/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/coldfire/clk.c +1 -1
index 2ed841e94111..d03b6c4aa86b 100644
@@ -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)
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Dan Carpenter

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.")

regards,
Marc

Signature · 4 lines
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 |
maintainer
#2 lore raw
In reply to Dan Carpenter
Quoted 8 lines · Dan Carpenter

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.")

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

Regards
Greg

Quoted 20 lines

---
I can't actually compile test this, but it's correct.

  arch/m68k/coldfire/clk.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/m68k/coldfire/clk.c +1 -1
index 2ed841e94111..d03b6c4aa86b 100644
@@ -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)