# \[PATCH\] can: tcan4x5x: get rid of false clock errors

- Subsystems: CAN NETWORK DRIVERS, MCAN DEVICE DRIVER, THE REST
- Maintainers: Marc Kleine-Budde, Vincent Mailhol, Markus Schneider-Pargmann, Linus Torvalds
- Status: LANDED (68d426da13fa · 2024-12-23 11:39)
- Landed in mainline as 68d426da13fa on 2024-12-23.
- List: linux-can
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-can/2024/11/2839708/t

## \[PATCH\] can: tcan4x5x: get rid of false clock errors

- From: Sean Nyekjaer \<hidden\>
- Date: 2024-11-28 08:32:47 
- Message: https://ratatoskr.run/linux-can/2024/11/2839708.md

```text
tcan4x5x devices only requires one clock cclk, so call devm_clk_get()
directly. This is done to avoid m_can_class_get_clocks() that checks for
both hclk and cclk.

tcan4x5x spi0.0: no clock found

Signed-off-by: Sean Nyekjaer <redacted>
---
 drivers/net/can/m_can/tcan4x5x-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/m_can/tcan4x5x-core.c b/drivers/net/can/m_can/tcan4x5x-core.c
index 7213d9894c82d079bf92f1ec62d4eebb500cdfa4..7463c40b909873b9c5bcc753f9db7009e9d66008 100644
--- a/drivers/net/can/m_can/tcan4x5x-core.c
+++ b/drivers/net/can/m_can/tcan4x5x-core.c
@@ -410,7 +410,7 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
 		priv->power = NULL;
 	}
 
-	m_can_class_get_clocks(mcan_class);
+	mcan_class->cclk = devm_clk_get(mcan_class->dev, "cclk");
 	if (IS_ERR(mcan_class->cclk)) {
 		dev_err(&spi->dev, "no CAN clock source defined\n");
 		freq = TCAN4X5X_EXT_CLK_DEF;

---
base-commit: e0b741bc53c94f9ae25d4140202557a0aa51b5a0
change-id: 20241127-mcancclk-741d21afcb29

Best regards,
-- 
Sean Nyekjaer [ref]

```

## Re: \[PATCH\] can: tcan4x5x: get rid of false clock errors

- From: Marc Kleine-Budde \<mkl@pengutronix.de\>
- Date: 2024-11-29 12:38:25 
- Message: https://ratatoskr.run/linux-can/2024/11/2840820.md

```text
On 28.11.2024 09:32:31, Sean Nyekjaer wrote:
> tcan4x5x devices only requires one clock cclk, so call devm_clk_get()
> directly. This is done to avoid m_can_class_get_clocks() that checks for
> both hclk and cclk.
> 
> tcan4x5x spi0.0: no clock found
> 
> Signed-off-by: Sean Nyekjaer <redacted>

Applied to linux-can-next/testing

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |
```
