Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH] can: rockchip_canfd: fix broken quirks checks
@ 2025-03-24 11:44 Weizhao Ouyang
  2025-03-24 13:44 ` Vincent Mailhol
  2025-04-15 10:31 ` Marc Kleine-Budde
  0 siblings, 2 replies; 3+ messages in thread
From: Weizhao Ouyang @ 2025-03-24 11:44 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Heiko Stuebner
  Cc: kernel, linux-can, linux-arm-kernel, linux-rockchip, linux-kernel,
	Weizhao Ouyang

First get the devtype_data then check quirks.

Fixes: bbdffb341498 ("can: rockchip_canfd: add quirk for broken CAN-FD support")
Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
---
 drivers/net/can/rockchip/rockchip_canfd-core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/rockchip/rockchip_canfd-core.c b/drivers/net/can/rockchip/rockchip_canfd-core.c
index d9a937ba126c..ac514766d431 100644
--- a/drivers/net/can/rockchip/rockchip_canfd-core.c
+++ b/drivers/net/can/rockchip/rockchip_canfd-core.c
@@ -907,15 +907,16 @@ static int rkcanfd_probe(struct platform_device *pdev)
 	priv->can.data_bittiming_const = &rkcanfd_data_bittiming_const;
 	priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
 		CAN_CTRLMODE_BERR_REPORTING;
-	if (!(priv->devtype_data.quirks & RKCANFD_QUIRK_CANFD_BROKEN))
-		priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD;
 	priv->can.do_set_mode = rkcanfd_set_mode;
 	priv->can.do_get_berr_counter = rkcanfd_get_berr_counter;
 	priv->ndev = ndev;
 
 	match = device_get_match_data(&pdev->dev);
-	if (match)
+	if (match) {
 		priv->devtype_data = *(struct rkcanfd_devtype_data *)match;
+		if (!(priv->devtype_data.quirks & RKCANFD_QUIRK_CANFD_BROKEN))
+			priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD;
+	}
 
 	err = can_rx_offload_add_manual(ndev, &priv->offload,
 					RKCANFD_NAPI_WEIGHT);
-- 
2.45.2


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

* Re: [PATCH] can: rockchip_canfd: fix broken quirks checks
  2025-03-24 11:44 [PATCH] can: rockchip_canfd: fix broken quirks checks Weizhao Ouyang
@ 2025-03-24 13:44 ` Vincent Mailhol
  2025-04-15 10:31 ` Marc Kleine-Budde
  1 sibling, 0 replies; 3+ messages in thread
From: Vincent Mailhol @ 2025-03-24 13:44 UTC (permalink / raw)
  To: Weizhao Ouyang
  Cc: kernel, linux-can, linux-arm-kernel, linux-rockchip, linux-kernel,
	Heiko Stuebner, Marc Kleine-Budde

Hi Weizhao,

Thanks for the patch.

On 24/03/2025 at 20:44, Weizhao Ouyang wrote:
> First get the devtype_data then check quirks.
> 
> Fixes: bbdffb341498 ("can: rockchip_canfd: add quirk for broken CAN-FD support")
> Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>

Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>


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

* Re: [PATCH] can: rockchip_canfd: fix broken quirks checks
  2025-03-24 11:44 [PATCH] can: rockchip_canfd: fix broken quirks checks Weizhao Ouyang
  2025-03-24 13:44 ` Vincent Mailhol
@ 2025-04-15 10:31 ` Marc Kleine-Budde
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2025-04-15 10:31 UTC (permalink / raw)
  To: Weizhao Ouyang
  Cc: Vincent Mailhol, Heiko Stuebner, kernel, linux-can,
	linux-arm-kernel, linux-rockchip, linux-kernel

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

On 24.03.2025 19:44:16, Weizhao Ouyang wrote:
> First get the devtype_data then check quirks.
> 
> Fixes: bbdffb341498 ("can: rockchip_canfd: add quirk for broken CAN-FD support")
> Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>

Applied to linux-can.

Thanks,
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   |

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

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

end of thread, other threads:[~2025-04-15 10:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24 11:44 [PATCH] can: rockchip_canfd: fix broken quirks checks Weizhao Ouyang
2025-03-24 13:44 ` Vincent Mailhol
2025-04-15 10:31 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox